Skip to content

Commit

Permalink
The most significant changes to the code involve the restructuring of…
Browse files Browse the repository at this point in the history
… job sequences and the introduction of a new input parameter `CreateRelease` in the `build-and-release.yml` file. This parameter is used to determine whether a new release should be created or not. The jobs to create a tag and a release draft, as well as the job to upload the MSI to the release, are now conditional based on this parameter. The job to upload a build artifact has been moved up in the sequence, while the job to upload the MSI to the release has been moved down. A job to upload a build artifact that was previously at the end of the sequence has been removed.

Changes:

1. The `build-and-release.yml` file has been updated to include a new input parameter `CreateRelease` with a default value of `false`. This parameter is used to determine whether a new release should be created or not.
2. The job to upload a build artifact has been moved up in the sequence of jobs. It now runs before the jobs to create a tag and a release draft.
3. The jobs to create a tag and a release draft, as well as the job to upload the MSI to the release, are now conditional. They only run if the `CreateRelease` input parameter is set to `true`.
4. The job to upload the MSI to the release has been moved down in the sequence of jobs. It now runs after the jobs to create a tag and a release draft.
5. The job to upload a build artifact that was previously at the end of the sequence of jobs has been removed.
  • Loading branch information
amgdy committed Apr 23, 2024
1 parent 863f35e commit 195af07
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
required: true
type: boolean
default: false
CreateRelease:
description: "Create Release"
required: true
type: boolean
default: false

name: 🏗️ Build & Release
run-name: 🏗️ Build Create release draft for ${{ github.event.inputs.Version }}
Expand Down Expand Up @@ -78,21 +83,24 @@ jobs:
- name: 🏭 Build MSI
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
uses: actions/upload-artifact@v4.3.1
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
run: |
git tag ${{ github.event.inputs.Version }}
git push origin ${{ github.event.inputs.Version }}
- name: 📝 Create release draft ${{ github.event.inputs.Version }}
if: github.event.inputs.CreateRelease
run: |
gh release create ${{ github.event.inputs.Version }} --target ${{ github.ref }} --draft --title "${{ github.event.inputs.version }}" --generate-notes --prerelease --draft
- name: 📤 Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: ${{env.MSI_FILE_NAME}}
path: ${{env.MSI_PROJECT_OUTPUT}}/${{env.MSI_FILE_NAME}}.msi

- name: 📤 Upload MSI to release ${{ github.event.inputs.Version }}
if: github.event.inputs.CreateRelease
run: |
gh release upload ${{ github.event.inputs.Version }} ${{env.MSI_PROJECT_OUTPUT}}/${{env.MSI_FILE_NAME}}.msi

0 comments on commit 195af07

Please sign in to comment.