-
-
Notifications
You must be signed in to change notification settings - Fork 50
70 lines (58 loc) · 1.82 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (58 loc) · 1.82 KB
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
name: Release
on:
push:
tags:
- '*'
jobs:
build-artifacts:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build
run: |
go build -o apx -ldflags="-X 'main.Version=${{ github.ref_name }}'" ./cmd
tar -czvf apx-amd64.tar.gz apx
GOARCH=arm64 go build -o apx -ldflags="-X 'main.Version=${{ github.sha }}'" ./cmd
tar -czvf apx-arm64.tar.gz apx
tar -czvf apx-man.tar.gz man/man1/apx.1
- name: Calculate and Save Checksums
run: sha256sum apx*.tar.gz >> checksums.txt
- uses: actions/upload-artifact@v7
with:
name: apx
path: |
apx*.tar.gz
checksums.txt
release:
runs-on: ubuntu-latest
needs: build-artifacts
permissions:
contents: write # to create and upload assets to releases
attestations: write # to upload assets attestation for build provenance
id-token: write # grant additional permission to attestation action to mint the OIDC token permission
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download Artifact
uses: actions/download-artifact@v8
with:
name: apx
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" --generate-notes apx*.tar.gz checksums.txt
- name: Attest Release Files
id: attest
uses: actions/attest-build-provenance@v4
with:
subject-path: 'apx*.tar.gz, checksums.txt'