-
Notifications
You must be signed in to change notification settings - Fork 12
134 lines (117 loc) · 3.85 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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