-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (66 loc) · 1.86 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- main
tags:
- "v*.*.*"
env:
ZIG_VERSION: 0.13.0
permissions:
id-token: write
contents: write
attestations: write
jobs:
build:
strategy:
matrix:
# FIXME: handle windows paths in attestation and upload steps
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v1
with:
version: ${{ env.ZIG_VERSION }}
- name: Get binary name
id: binary_name
run: echo "binary_name=zlint-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_OUTPUT"
- name: zig build
env:
BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }}
run: |
zig build --summary all --color on --release=safe
mv zig-out/bin/zlint zig-out/bin/${{ env.BINARY_NAME }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: zig-out/bin/${{ steps.binary_name.outputs.binary_name }}
- name: Upload zlint binary
uses: actions/upload-artifact@v4
with:
path: zig-out/bin/zlint-${{ runner.os }}-${{ runner.arch }}
name: zlint-${{ runner.os }}-${{ runner.arch }}
retention-days: 1
# TODO
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
pattern: zlint-*
path: zig-out/dist
merge-multiple: true
# TODO
- run: ls -lA zig-out/dist
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: zig-out/dist/*