Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish

on:
push:
tags: ['v*']
workflow_dispatch:
release:
types: [published]

env:
DOTNET_NOLOGO: true
Expand All @@ -13,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
contents: write
id-token: write # Needed for NuGet trusted publishing, I have no idea how this works I'm just reading docs

steps:
Expand All @@ -30,12 +29,8 @@ jobs:

- name: Pack
run: |
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
VERSION="${GITHUB_REF_NAME#v}"
dotnet pack NetSerializer/NetSerializer.csproj -c Release -o out /p:Version="$VERSION"
else
dotnet pack NetSerializer/NetSerializer.csproj -c Release -o out
fi
VERSION="${GITHUB_REF_NAME#v}"
dotnet pack NetSerializer/NetSerializer.csproj -c Release -o out /p:Version="$VERSION"

- name: NuGet login (trusted publishing)
uses: NuGet/login@v1
Expand All @@ -45,3 +40,8 @@ jobs:

- name: Push
run: dotnet nuget push "out/*.nupkg" --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate

- name: Attach packages to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "$GITHUB_REF_NAME" out/*.nupkg out/*.snupkg
2 changes: 1 addition & 1 deletion NetSerializer/NetSerializer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>A very fast and minimal serializer</Description>
<Company>Space Wizards Federation</Company>
<Copyright>Copyright © 2012-2019 Tomi Valkeinen; Copyright © Space Wizards Federation contributors</Copyright>
<Version>1.0.0</Version>
<Version>0.0.0-dev</Version>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<Authors>Tomi Valkeinen;$(Company)</Authors>
<PackageTags>Serializer</PackageTags>
Expand Down
Loading