1name: release
2on:
3 push:
4 tags:
5 - "v*"
6
7env:
8 CARGO_TERM_COLOR: always
9 RUSTFLAGS: "-D warnings"
10
11permissions:
12 contents: read
13
14jobs:
15 build-release:
16 name: build-release
17 runs-on: ${{ matrix.os }}
18 permissions:
19 id-token: write
20 attestations: write
21 strategy:
22 matrix:
23 target:
24 - x86_64-unknown-linux-musl
25 - aarch64-unknown-linux-musl
26 - x86_64-apple-darwin
27 - aarch64-apple-darwin
28 - x86_64-pc-windows-msvc
29 - aarch64-pc-windows-msvc
30 toolchain: [ stable ]
31 include:
32 - os: ubuntu-latest
33 target: x86_64-unknown-linux-musl
34 expected-binary-architecture: x86-64
35 cargo-tool: cross
36 - os: ubuntu-latest
37 target: aarch64-unknown-linux-musl
38 expected-binary-architecture: aarch64
39 cargo-tool: cross
40 # macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
41 - os: macos-13
42 target: x86_64-apple-darwin
43 expected-binary-architecture: x86_64
44 cargo-tool: cargo
45 - os: macos-latest
46 target: aarch64-apple-darwin
47 expected-binary-architecture: arm64
48 cargo-tool: cargo
49 - os: windows-latest
50 target: x86_64-pc-windows-msvc
51 expected-binary-architecture: x86-64
52 cargo-tool: cargo
53 - os: windows-11-arm
54 target: aarch64-pc-windows-msvc
55 expected-binary-architecture: arm64
56 cargo-tool: cargo
57 - os: ubuntu-latest
58 target: wasm32-unknown-unknown
59 cargo-tool: wasm-pack
60 steps:
61 - name: Checkout repository
62 uses: actions/checkout@v4
63
64 - name: "Build Archive"
65 id: build
66 uses: "./.github/actions/build-release"
67 with:
68 version: ${{ github.ref_name }}
69 toolchain: ${{ matrix.toolchain }}
70 target: ${{ matrix.target }}
71 cargo-tool: ${{ matrix.cargo-tool }}
72 expected-binary-architecture: ${{ matrix.expected-binary-architecture }}
73
74 create-release:
75 name: create-release
76
77 needs: ['build-release']
78
79 runs-on: ubuntu-latest
80
81 permissions:
82 contents: write
83
84 steps:
85 - name: Download Artifacts
86 uses: actions/download-artifact@v4
87 with:
88 pattern: release-*
89 merge-multiple: true
90
91 - name: Create release
92 env:
93 GITHUB_TOKEN: '${{ github.token }}'
94 REPOSITORY: '${{ github.repository }}'
95 TITLE: '${{ github.ref_name }}'
96 TAG_NAME: '${{ github.ref_name }}'
97 NOTES: '${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/CHANGELOG.md'
98 run: |
99 gh release create \
100 --repo "$REPOSITORY" \
101 --title "$TITLE" \
102 --notes "$NOTES" \
103 --draft \
104 --verify-tag \
105 ${{ contains(github.ref_name, '-rc') && '--prerelease' || '' }} \
106 "$TAG_NAME" \
107 gleam-*