Skip to content

Commit

Permalink
Update pubtest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
axunonb authored Feb 12, 2025
1 parent 98334a4 commit 3c18410
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/pubtest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: PubTest
# This job builds and publishes the package to NuGet.
# It depends on the included tests job to complete successfully.
# The version number is determined by the latest 'v*' tag for the main branch.
Expand Down Expand Up @@ -59,19 +59,21 @@ jobs:
dotnet-version: |
8.0.x
- name: Get version tag
# The latest tag for the selected branch.
# Get it and strip off any leading 'v' from the version tag
# The latest tag for the selected branch.
# Get it and strip off any leading 'v' from the version tag
run: |
# The version variable will be e.g. like "5.1.0-pre.1" (pre-release) or "5.1.0" (release)
Version=$(git tag --list 'v*' --sort=-v:refname | head -n 1 | sed 's/^v//')
FileVersion=${{ env.VERSION%%-* }}
AssemblyVersion=${{ env.VERSION%%.* }}.0
echo "VERSION=$Version" >> $GITHUB_ENV
echo "FILE_VERSION=$FileVersion" >> $GITHUB_ENV
echo "ASSEMBLY_VERSION=$AssemblyVersion" >> $GITHUB_ENV
echo "Version: $Version"
echo "File Version: $FileVersion"
echo "Assembly Version: $AssemblyVersion"
# The version variable will be e.g. like "5.1.0-pre.1" (pre-release) or "5.1.0" (release)
Version=$(git tag --list 'v*' --sort=-v:refname | head -n 1 | sed 's/^v//')
echo "VERSION=$Version" >> $GITHUB_ENV
echo "Version: $Version"
- name: Set version variables
run: |
FileVersion=${VERSION%%-*}
AssemblyVersion=${VERSION%%.*}.0
echo "FILE_VERSION=$FileVersion" >> $GITHUB_ENV
echo "ASSEMBLY_VERSION=$AssemblyVersion" >> $GITHUB_ENV
echo "File Version: $FileVersion"
echo "Assembly Version: $AssemblyVersion"
- name: Reset branch to specified tag
run: git reset --hard v${{ env.VERSION }}
- name: Restore dependencies
Expand All @@ -89,3 +91,4 @@ jobs:
path: |
Ical.Net/bin/Release/**/*.nupkg
Ical.Net/bin/Release/**/*.snupkg

0 comments on commit 3c18410

Please sign in to comment.