Skip to content

Commit f157f2f

Browse files
authored
Add GitHub workflow for NuGet publish (#46)
1 parent aea9389 commit f157f2f

4 files changed

Lines changed: 82 additions & 4 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish NuGet Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
- '[0-9]+.[0-9]+.[0-9]+-*'
8+
9+
jobs:
10+
build-and-publish:
11+
name: Build and Publish NuGet
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: 9.0
20+
- name: Extract Version from Tag
21+
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
22+
- name: Install Dependencies
23+
run: dotnet restore
24+
- name: Build Solution
25+
run: |
26+
dotnet build --configuration Release \
27+
--no-restore \
28+
-p:CI_BUILD=true \
29+
-p:Version=${{env.VERSION}} \
30+
-p:PackageVersion=${{env.VERSION}} \
31+
- name: Pack NuGet Packages
32+
run: |
33+
dotnet pack --configuration Release \
34+
--no-build \
35+
-p:CI_BUILD=true \
36+
-p:Version=${{env.VERSION}} \
37+
-p:PackageVersion=${{env.VERSION}} \
38+
--output ./artifacts
39+
- name: Publish to NuGet
40+
env:
41+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
42+
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY

.gitignore

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,40 @@ ASALocalRun/
327327
*.nvuser
328328

329329
# MFractors (Xamarin productivity tool) working folder
330-
.mfractor/
330+
.mfractor/# Created by https://www.toptal.com/developers/gitignore/api/macos
331+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos
332+
333+
### macOS ###
334+
# General
335+
.DS_Store
336+
.AppleDouble
337+
.LSOverride
338+
339+
# Icon must end with two \r
340+
Icon
341+
342+
# Thumbnails
343+
._*
344+
345+
# Files that might appear in the root of a volume
346+
.DocumentRevisions-V100
347+
.fseventsd
348+
.Spotlight-V100
349+
.TemporaryItems
350+
.Trashes
351+
.VolumeIcon.icns
352+
.com.apple.timemachine.donotpresent
353+
354+
# Directories potentially created on remote AFP share
355+
.AppleDB
356+
.AppleDesktop
357+
Network Trash Folder
358+
Temporary Items
359+
.apdisk
360+
361+
### macOS Patch ###
362+
# iCloud generated files
363+
*.icloud
364+
365+
# End of https://www.toptal.com/developers/gitignore/api/macos
366+

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

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

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

Package.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageId>$(AssemblyName)</PackageId>
2323
<PackageVersion>0.0.0</PackageVersion> <!-- Will be passed to the build -->
2424
<Authors>Digitec Galaxus AG</Authors>
25-
<Copyright>2018-2023 Digitec Galaxus AG</Copyright>
25+
<Copyright>2018-2024 Digitec Galaxus AG</Copyright>
2626
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2727
<PackageProjectUrl>https://github.com/DigitecGalaxus/Galaxus.Functional</PackageProjectUrl>
2828
<RepositoryUrl>https://github.com/DigitecGalaxus/Galaxus.Functional</RepositoryUrl>

0 commit comments

Comments
 (0)