Skip to content

Commit 5e5a7b6

Browse files
Add Checksums and Attestation (#196)
1 parent 780c24e commit 5e5a7b6

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ env:
1919
RUNNER_SERVER_VERSION: "3.11.16"
2020
jobs:
2121
build:
22+
permissions:
23+
id-token: write
24+
attestations: write
25+
contents: read
2226
runs-on: ubuntu-latest
2327
strategy:
2428
#
@@ -75,9 +79,10 @@ jobs:
7579
with:
7680
submodules: recursive
7781
- name: Setup Go
78-
uses: actions/setup-go@v3
82+
uses: actions/setup-go@v5
7983
with:
80-
go-version: "${{matrix.GOVERSION || vars.GOVERSION || '^1.16.0'}}"
84+
go-version: "${{ matrix.GOVERSION || vars.GOVERSION || '^1.16.0' }}"
85+
cache: false
8186
- name: Setup cgo ndk
8287
if: matrix.GOOS == 'android'
8388
run: |
@@ -117,6 +122,22 @@ jobs:
117122
cp compat/*.cmd output/
118123
cd output
119124
zip ../binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.zip ./*
125+
- name: Create Signed Provenance
126+
uses: actions/attest-build-provenance@v1
127+
id: attest
128+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.skip-packaging != 'true' }}
129+
with:
130+
subject-path: binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.${{ matrix.GOOS == 'windows' && 'zip' || 'tar.gz' }}
131+
- name: Copy Signed Provenance to well known filepath
132+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.skip-packaging != 'true' }}
133+
run: |
134+
cp "$BUNDLE_PATH" binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.sigstore.json
135+
env:
136+
BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path }}
137+
- name: Create Package Checksums
138+
if: ${{ github.event.inputs.skip-packaging != 'true' }}
139+
run: |
140+
sha512sum binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.${{ matrix.GOOS == 'windows' && 'zip' || 'tar.gz' }} > binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.sha512
120141
- uses: actions/upload-artifact@v4
121142
with:
122143
name: binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}
@@ -125,7 +146,9 @@ jobs:
125146
if: ${{ github.event.inputs.skip-packaging != 'true' }}
126147
with:
127148
name: bundle-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}
128-
path: 'binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.*'
149+
path: |
150+
binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.*
151+
129152
#######################################
130153
########## publish to github ##########
131154
#######################################
@@ -141,7 +164,7 @@ jobs:
141164
path: "artifacts"
142165
- uses: ncipollo/release-action@v1
143166
with:
144-
artifacts: "artifacts/**/*.zip,artifacts/**/*.tar.gz"
167+
artifacts: "artifacts/**/*.zip,artifacts/**/*.tar.gz,artifacts/**/*.sha512,artifacts/**/*.sigstore.json"
145168
token: ${{ secrets.GITHUB_TOKEN }}
146169
tag: v${{ github.event.inputs.version }}
147170
commit: ${{ github.sha }}
@@ -179,7 +202,7 @@ jobs:
179202
with:
180203
path: "artifacts"
181204
- name: add cppfw repo to install myci scripts from
182-
uses: myci-actions/add-deb-repo@master
205+
uses: myci-actions/add-deb-repo@e2d8b32bd968fb27d9934670a4f27857194b607d
183206
with:
184207
repo: deb https://gagis.hopto.org/repo/cppfw/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main
185208
repo-name: cppfw
@@ -203,7 +226,7 @@ jobs:
203226
- name: create deb package
204227
run: |
205228
docker run -v "$PWD:$PWD" -w "$PWD" -e "DEPLOY_ARCHS=$DEPLOY_ARCHS" --rm ubuntu:noble bash script.sh
206-
- uses: actions/upload-artifact@v3
229+
- uses: actions/upload-artifact@v4
207230
continue-on-error: true
208231
with:
209232
name: debs
@@ -274,7 +297,7 @@ jobs:
274297
working-directory: logs
275298
- name: Upload Test Results
276299
if: ${{always()}}
277-
uses: actions/upload-artifact@v3
300+
uses: actions/upload-artifact@v4
278301
with:
279302
name: test-results-linux-amd64
280303
path: 'logs.tar.gz'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Unlike the official [actions/runner](https://github.com/actions/runner), this wo
2222
(*1) Reachable docker daemon use `DOCKER_HOST` to specify a remote host.
2323

2424
### NodeJS via PATH
25-
(*2) For best compatibility with existing nodejs actions, please add nodejs in version 12 to your `PATH`, newer nodejs versions might lead to workflow failures.
25+
(*2) For best compatibility with existing nodejs actions, please add nodejs in version 20 to your `PATH`, newer nodejs versions might lead to workflow failures.
2626

2727
## Usage for github releases
2828

0 commit comments

Comments
 (0)