Fork of daniellemaywood.uk/gleam — Wasm codegen work
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 environment: release
19 permissions:
20 id-token: write
21 attestations: write
22 strategy:
23 matrix:
24 target:
25 - x86_64-unknown-linux-musl
26 - aarch64-unknown-linux-musl
27 - x86_64-apple-darwin
28 - aarch64-apple-darwin
29 - x86_64-pc-windows-msvc
30 - aarch64-pc-windows-msvc
31 toolchain: [ stable ]
32 include:
33 - os: ubuntu-latest
34 target: x86_64-unknown-linux-musl
35 expected-binary-architecture: x86-64
36 cargo-tool: cross
37 - os: ubuntu-latest
38 target: aarch64-unknown-linux-musl
39 expected-binary-architecture: aarch64
40 cargo-tool: cross
41 - os: macos-15-intel
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-2022
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
63 with:
64 persist-credentials: false
65
66 - name: "Build Archive"
67 id: build
68 uses: "./.github/actions/build-release"
69 with:
70 version: ${{ github.ref_name }}
71 toolchain: ${{ matrix.toolchain }}
72 target: ${{ matrix.target }}
73 cargo-tool: ${{ matrix.cargo-tool }}
74 expected-binary-architecture: ${{ matrix.expected-binary-architecture }}
75 generate-gleam-licences-html: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
76 azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
77 azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
78 azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
79 azure-trusted-signing-account-name: ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
80 azure-certificate-profile-name: ${{ vars.AZURE_CERTIFICATE_PROFILE_NAME }}
81
82 create-release:
83 name: create-release
84
85 needs: ['build-release']
86
87 runs-on: ubuntu-latest
88
89 environment: release
90
91 permissions:
92 contents: write
93
94 steps:
95 - name: Download Artifacts
96 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
97 with:
98 pattern: release-*
99 merge-multiple: true
100
101 - name: Create release
102 env:
103 GITHUB_TOKEN: '${{ github.token }}'
104 REPOSITORY: '${{ github.repository }}'
105 TITLE: '${{ github.ref_name }}'
106 TAG_NAME: '${{ github.ref_name }}'
107 NOTES: '${{ github.server_url }}/${{ github.repository }}/blob/${{ github.ref_name }}/CHANGELOG.md'
108 run: |
109 gh release create \
110 --repo "$REPOSITORY" \
111 --title "$TITLE" \
112 --notes "$NOTES" \
113 --draft \
114 --verify-tag \
115 ${{ contains(github.ref_name, '-rc') && '--prerelease' || '' }} \
116 "$TAG_NAME" \
117 gleam-*