Github actions: remove debugging code #19
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
name: Windows | |
#run-name: ${{ github.actor }} is learning GitHub Actions | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
outputs: | |
hashes: ${{ steps.hash.outputs.hashes }} | |
runs-on: windows-2019 | |
env: | |
SOLUTION: Windows\supercan.sln | |
MSBUILD_OPTIONS: -noLogo -m -t:Build -p:Configuration=Release | |
ResourcesExtraDefines: SC_BUILD_NUMBER=$(GITHUB_RUN_NUMBER) | |
VCVARS32: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat | |
VCVARS64: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat | |
SC_BUILD_QT_PLUGIN: 0 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: microsoft/[email protected] | |
- name: Build | |
shell: cmd | |
run: appveyor\windows.cmd | |
# run: | | |
# set | |
# echo 1 >supercan-win.7z | |
# echo 2 >supercan_inst.exe | |
- name: Generate hashes | |
shell: bash | |
id: hash | |
run: | | |
# sha256sum generates sha256 hash for all artifacts. | |
# base64 -w0 encodes to base64 and outputs on a single line. | |
# sha256sum artifact1 artifact2 ... | base64 -w0 | |
echo "hashes=$(sha256sum supercan-win.7z supercan_inst.exe | base64 -w0)" >> "$GITHUB_OUTPUT" | |
- name: Upload supercan-win.7z | |
uses: actions/upload-artifact@v3 | |
with: | |
path: supercan-win.7z | |
name: supercan-win.7z | |
if-no-files-found: error | |
- name: Upload supercan_inst.exe | |
uses: actions/upload-artifact@v3 | |
with: | |
path: supercan_inst.exe | |
name: supercan_inst.exe | |
if-no-files-found: error | |
# This step calls the generic workflow to generate provenance. | |
provenance-release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: [build] | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
base64-subjects: "${{ needs.build.outputs.hashes }}" | |
# Upload provenance to a new release | |
upload-assets: true | |
# This step calls the generic workflow to generate provenance. | |
provenance-latest: | |
if: startsWith(github.ref, 'refs/heads/') | |
needs: [build] | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | |
with: | |
base64-subjects: "${{ needs.build.outputs.hashes }}" | |
# Upload provenance to a new release | |
upload-assets: true | |
upload-tag-name: latest-master | |
# This step uploads our artifacts to the tagged GitHub release. | |
release: | |
needs: [build, provenance-release] | |
runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download supercan-win.7z | |
uses: actions/download-artifact@v3 | |
with: | |
name: supercan-win.7z | |
- name: Download supercan_inst.exe | |
uses: actions/download-artifact@v3 | |
with: | |
name: supercan_inst.exe | |
- name: Upload assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
supercan-win.7z | |
supercan_inst.exe | |
latest: | |
needs: [build, provenance-latest] | |
runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/heads/') | |
steps: | |
- name: Download supercan-win.7z | |
uses: actions/download-artifact@v3 | |
with: | |
name: supercan-win.7z | |
- name: Download supercan_inst.exe | |
uses: actions/download-artifact@v3 | |
with: | |
name: supercan_inst.exe | |
- name: Upload assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
# name: latest-master | |
tag_name: latest-master | |
files: | | |
supercan-win.7z | |
supercan_inst.exe |