-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
# 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,20 +106,20 @@ 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/ | ||
|
||
# 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,33 +160,35 @@ 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 | ||
WITH_V: true | ||
|
||
# (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 }} | ||
|