Skip to content

Commit

Permalink
publish on release
Browse files Browse the repository at this point in the history
  • Loading branch information
Brennan1994 committed Aug 28, 2024
1 parent 4d0c4f8 commit 49454cb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Publish NuGet Packages

on:
push:
branches:
- main
release:
types: [published]

env:
Project_Name: Consequences/Consequences.csproj

Expand All @@ -21,12 +21,12 @@ jobs:
dotnet-version: '8.x'

- name: Create version number
shell: bash
shell: pwsh
run: |
BRANCH=$(echo $GITHUB_REF | sed 's/refs\/heads\///')
BRANCH=$(echo $BRANCH | sed 's/[^a-zA-Z0-9]/-/g')
VERSION="1.0.0-$BRANCH-$GITHUB_RUN_NUMBER"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
$VERSION = $TAG -replace '^v', ''
$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 /p:PackageVersion=${{ env.VERSION }}
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
dotnet-version: '8.x'

- name: Create version number
id: create_version
shell: bash
run: |
BRANCH=$(echo $GITHUB_REF | sed 's/refs\/heads\///')
BRANCH=$(echo $BRANCH | sed 's/[^a-zA-Z0-9]/-/g')
Expand Down

0 comments on commit 49454cb

Please sign in to comment.