Skip to content

Commit

Permalink
The most significant changes involve the update of the TAG_NAME env…
Browse files Browse the repository at this point in the history
…ironment variable and the correction of conditional statements in the `build-and-release.yml` file. The `TAG_NAME` environment variable now uses the `Version` input instead of the `CreateRelease` input. The conditional statements in the `build-and-release.yml` file have been corrected to use the proper syntax for GitHub Actions. This includes conditions for building the app, uploading a build artifact, creating a tag, creating a release draft, and uploading the MSI to the release. Additionally, the `SelfContained` and `CreateRelease` inputs are now correctly checked for both `true` and `false` values in the respective conditions.

Changes:
1. The `TAG_NAME` environment variable in the `build-and-release.yml` file has been updated to use the `Version` input instead of the `CreateRelease` input.
2. The conditional statements in the `build-and-release.yml` file have been updated to use the correct syntax for GitHub Actions. This includes the conditions for building the app, uploading a build artifact, creating a tag, creating a release draft, and uploading the MSI to the release.
3. The `SelfContained` input is now being correctly checked for both `true` and `false` values in the conditions for building the app.
4. The `CreateRelease` input is now being correctly checked for both `true` and `false` values in the conditions for uploading a build artifact, creating a tag, creating a release draft, and uploading the MSI to the release.
  • Loading branch information
amgdy committed Apr 23, 2024
1 parent 96b591f commit 937068f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:
env:
VERSION: ${{ github.event.inputs.Version }}
SELF_CONTAINED: ${{ github.event.inputs.SelfContained }}
TAG_NAME: v${{ github.event.inputs.CreateRelease }}
TAG_NAME: v${{ github.event.inputs.Version }}

jobs:
build:
Expand Down Expand Up @@ -69,11 +69,11 @@ jobs:
run: dotnet restore src

- name: 🏗️ Build App
if: github.event.inputs.SelfContained == false
if: ${{ github.event.inputs.SelfContained == false }}
run: dotnet publish ${{env.APP_PROJECT_PATH}} -c=Release -o=${{env.APP_PROJECT_OUTPUT}} --p:FileVersion=${{env.VERSION}} --p:AssemblyVersion=${{env.VERSION}} --p:Version=${{env.VERSION}} -p:SourceRevisionId=${{ github.sha }}

- name: 🏗️ Build App (Self-contained)
if: github.event.inputs.SelfContained
if: ${{ github.event.inputs.SelfContained == true }}
run: dotnet publish ${{env.APP_PROJECT_PATH}} -c=Release -o=${{env.APP_PROJECT_OUTPUT}} --p:FileVersion=${{env.VERSION}} --p:AssemblyVersion=${{env.VERSION}} --p:Version=${{env.VERSION}} -r=win-x64 --self-contained=true -p:SourceRevisionId=${{ github.sha }}

- name: 🔧 Setup WiX v5
Expand All @@ -83,28 +83,28 @@ jobs:
run: dotnet build ${{env.MSI_PROJECT_PATH}} -c=Release -o=${{env.MSI_PROJECT_OUTPUT}} -p:Version=${{env.VERSION}} -p:AppDir=${{env.APP_PROJECT_OUTPUT}} -p:OutputName=${{env.MSI_FILE_NAME}} -p:SourceRevisionId=${{ github.sha }}

- name: 📤 Upload a Build Artifact
if: github.event.inputs.CreateRelease == false
if: ${{ github.event.inputs.CreateRelease == false }}
uses: actions/[email protected]
with:
name: ${{env.MSI_FILE_NAME}}
path: ${{env.MSI_PROJECT_OUTPUT}}\${{env.MSI_FILE_NAME}}.msi

- name: 🏷️ Create tag ${{ github.event.inputs.Version }}
if: github.event.inputs.CreateRelease
if: ${{ github.event.inputs.CreateRelease == true }}
run: |
git tag ${{ github.event.inputs.Version }}
git push origin ${{ github.event.inputs.Version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 📝 Create release draft ${{ env.TAG_NAME }}
if: github.event.inputs.CreateRelease
if: ${{ github.event.inputs.CreateRelease == true }}
run: gh release create ${{ env.TAG_NAME }} --target ${{ github.ref }} --draft --title "${{ env.TAG_NAME }}" --generate-notes --prerelease --draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 📤 Upload MSI to release ${{ env.TAG_NAME }}
if: github.event.inputs.CreateRelease
if: ${{ github.event.inputs.CreateRelease == true }}
run: gh release upload ${{ env.TAG_NAME }} ${{env.MSI_PROJECT_OUTPUT}}\${{env.MSI_FILE_NAME}}.msi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 937068f

Please sign in to comment.