Skip to content

Commit

Permalink
Add GitHub workflow for NuGet publish (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcyja authored Dec 6, 2024
1 parent aea9389 commit f157f2f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish NuGet Packages

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'

jobs:
build-and-publish:
name: Build and Publish NuGet
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0
- name: Extract Version from Tag
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Install Dependencies
run: dotnet restore
- name: Build Solution
run: |
dotnet build --configuration Release \
--no-restore \
-p:CI_BUILD=true \
-p:Version=${{env.VERSION}} \
-p:PackageVersion=${{env.VERSION}} \
- name: Pack NuGet Packages
run: |
dotnet pack --configuration Release \
--no-build \
-p:CI_BUILD=true \
-p:Version=${{env.VERSION}} \
-p:PackageVersion=${{env.VERSION}} \
--output ./artifacts
- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,40 @@ ASALocalRun/
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/
.mfractor/# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

# End of https://www.toptal.com/developers/gitignore/api/macos

Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2018-2023 Digitec Galaxus AG
2018-2023 Galaxus.Functional contributors (see https://github.com/DigitecGalaxus/Galaxus.Functional/graphs/contributors)
Copyright (c) 2018-2024 Digitec Galaxus AG
2018-2024 Galaxus.Functional contributors (see https://github.com/DigitecGalaxus/Galaxus.Functional/graphs/contributors)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Package.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageId>$(AssemblyName)</PackageId>
<PackageVersion>0.0.0</PackageVersion> <!-- Will be passed to the build -->
<Authors>Digitec Galaxus AG</Authors>
<Copyright>2018-2023 Digitec Galaxus AG</Copyright>
<Copyright>2018-2024 Digitec Galaxus AG</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/DigitecGalaxus/Galaxus.Functional</PackageProjectUrl>
<RepositoryUrl>https://github.com/DigitecGalaxus/Galaxus.Functional</RepositoryUrl>
Expand Down

0 comments on commit f157f2f

Please sign in to comment.