Skip to content

Commit

Permalink
Cleanup build and publish to use VersionLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Jun 14, 2024
1 parent b8fd87b commit 14deaea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ on:

env:
DOTNET_NOLOGO: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
PackOnBuild: true
GeneratePackageOnBuild: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}

defaults:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
Configuration: Release
PackOnBuild: true
GeneratePackageOnBuild: true
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
Expand All @@ -25,7 +26,7 @@ jobs:
fetch-depth: 0

- name: 🙏 build
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v} -bl:build.binlog
run: dotnet build -m:1 -bl:build.binlog

- name: 🧪 test
uses: ./.github/workflows/test
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<_VersionLabel>$(VersionLabel.Replace('refs/heads/', ''))</_VersionLabel>
<_VersionLabel>$(_VersionLabel.Replace('refs/tags/v', ''))</_VersionLabel>

<!-- For PRs, we just need a fixed package version numbered after the PR # itself, so remove the commits # at the end -->
<!-- For PRs, we just need a fixed package version numbered after the PR # itself, so remove the commits # at the end -->
<_VersionLabel Condition="$(_VersionLabel.Contains('refs/pull/'))">$(VersionLabel.TrimEnd('.0123456789'))</_VersionLabel>
<!-- Next replace the prefix for simply 'pr', so we end up with 'pr99/merge' by default -->
<_VersionLabel>$(_VersionLabel.Replace('refs/pull/', 'pr'))</_VersionLabel>
Expand Down

0 comments on commit 14deaea

Please sign in to comment.