From f3e9725b04f97e85c470a5df0352ad2a3d632c11 Mon Sep 17 00:00:00 2001 From: Stefan Tucker Date: Sat, 25 Mar 2023 00:15:50 -0500 Subject: [PATCH] Workflow: Updated versions. #patch --- .github/workflows/msbuild.yml | 51 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 7beeb3c..c5bd34f 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -27,15 +27,19 @@ jobs: build: if: (github.event_name == 'workflow_dispatch') || (!contains(toJson(github.event.commits.*.message), '***NO_CI***') && !contains(toJson(github.event.commits.*.message), '[ci skip]') && !contains(toJson(github.event.commits.*.message), '[skip ci]')) + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners runs-on: windows-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1 - + uses: microsoft/setup-msbuild@v1.1 +# with: + # '[17.0,17.2)]' Use 17.0 to 17.2, exclusive (i.e., not 17.2). +# vs-version: '[17.0,)' + - name: Restore NuGet packages run: nuget restore ${{env.SOLUTION_FILE_PATH}} @@ -65,7 +69,7 @@ jobs: # https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#about-workflow-artifacts # https://github.com/marketplace/actions/upload-a-build-artifact - name: Upload installer files folder as a build artifact - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v3 with: name: publish-build path: ./installer/files/ @@ -84,14 +88,14 @@ jobs: TagNoV: ${{ steps.StepTagNoV.outputs.new_tag }} steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # https://github.com/marketplace/actions/github-tag-bump # We want to use the tag without the 'v' prefix for the release name. # The action does not output that, so we perform a dry run to get the tag without 'v'. - name: Get tag without 'v' prefix id: StepTagNoV - uses: anothrNick/github-tag-action@1.34.0 + uses: anothrNick/github-tag-action@1.61.0 env: DRY_RUN: true DEFAULT_BUMP: none @@ -102,12 +106,12 @@ jobs: runs-on: windows-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Download publish artifact from previous job # https://github.com/marketplace/actions/download-a-build-artifact - name: Download deployment folder as a build artifact - uses: actions/download-artifact@v2.0.9 + uses: actions/download-artifact@v3 with: name: publish-build path: ./installer/files/ @@ -115,7 +119,7 @@ jobs: # Delete publish artifact so it does not count against storage # https://github.com/marketplace/actions/delete-artifact - name: Delete build artifact - uses: GeekyEggo/delete-artifact@v1.0.0 + uses: GeekyEggo/delete-artifact@v2 with: name: publish-build failOnError: false @@ -125,11 +129,16 @@ jobs: # https://github.com/NSIS-Dev/github-action-examples/ - name: Install NSIS run: | - Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') - scoop bucket add extras - scoop install nsis - #ALT scoop bucket add nsis https://github.com/NSIS-Dev/scoop-nsis - #ALT scoop install nsis/nsis + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + # From actions/runner-images: + # https://github.com/actions/runner-images/blob/main/images/win/scripts/Installers/Install-NSIS.ps1 + $NsisVersion = '3.08' + Install-Binary -Url "https://downloads.sourceforge.net/project/nsis/NSIS%203/${NsisVersion}/nsis-${NsisVersion}-setup.exe" -Name "nsis-${NsisVersion}-setup.exe" -ArgumentList ('/S') + #OLD Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') + #OLD scoop bucket add extras + #OLD scoop install nsis + #OLD ALT scoop bucket add nsis https://github.com/NSIS-Dev/scoop-nsis + #OLD ALT scoop install nsis/nsis makensis -VERSION makensis -HDRINFO @@ -140,7 +149,7 @@ jobs: run: makensis -DgVerInstaller=${{ needs.version.outputs.TagNoV }}.0 Timekeeper.nsi - name: Upload installer as an artifact - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v3 with: name: publish-package path: ./installer/timekeeper-setup.exe @@ -151,23 +160,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download installer as an artifact - uses: actions/download-artifact@v2.0.9 + uses: actions/download-artifact@v3 with: name: publish-package path: ./installer/ - name: Delete installer artifact - uses: GeekyEggo/delete-artifact@v1.0.0 + uses: GeekyEggo/delete-artifact@v2 with: name: publish-package failOnError: false - name: Bump version and push tag id: StepBump - uses: anothrNick/github-tag-action@1.34.0 + uses: anothrNick/github-tag-action@1.61.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEFAULT_BUMP: none @@ -175,9 +184,11 @@ jobs: # (This could be a separate action triggered by pushing a tag.) # https://github.com/marketplace/actions/create-release + # This error means that the a release with this tag already exists. + # Error 422: Validation Failed: {"resource":"Release","code":"already_exists","field":"tag_name"} - name: Create release with artifact if: success() && needs.version.outputs.TagNoV && steps.StepBump.outputs.new_tag - uses: ncipollo/release-action@v1 + uses: ncipollo/release-action@v1.12.0 with: tag: ${{ steps.StepBump.outputs.new_tag }} name: ${{ needs.version.outputs.TagNoV }}