Skip to content

Commit

Permalink
build before setting version
Browse files Browse the repository at this point in the history
  • Loading branch information
Brennan1994 committed Aug 28, 2024
1 parent 9bece94 commit 80a1a93
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ jobs:
uses: actions/[email protected]

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '8.x'

- name: Restore dependencies
run: dotnet restore

- name: Build for Windows x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r win-x64 --self-contained -p:PublishAot=true

- name: Create version number
shell: pwsh
run: |
Expand All @@ -32,9 +35,6 @@ jobs:
$VERSION = "$VERSION.$env:GITHUB_RUN_NUMBER"
echo "VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build for Windows x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r win-x64 --self-contained -p:PublishAot=true

- name: Pack NuGet packages
run: dotnet pack ${{ env.PROJECT_NAME }} -c Release /p:PackageVersion=${{ env.VERSION }}

Expand All @@ -56,23 +56,23 @@ jobs:
uses: actions/[email protected]

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4.0.1
with:
dotnet-version: '8.x'

- name: Restore dependencies
run: dotnet restore

- name: Build for Linux x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r linux-x64 --self-contained -p:PublishAot=true

- name: Create version number
id: vars
run: |
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
VERSION=${TAG#v}
echo "VERSION=${VERSION}.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Build for Linux x64
run: dotnet publish ${{ env.PROJECT_NAME }} -c Release -r linux-x64 --self-contained -p:PublishAot=true

- name: Pack NuGet packages
run: dotnet pack ${{ env.PROJECT_NAME }} -c Release /p:PackageVersion=${{ env.VERSION }}

Expand Down

0 comments on commit 80a1a93

Please sign in to comment.