-
-
Notifications
You must be signed in to change notification settings - Fork 991
171 lines (157 loc) · 5.36 KB
/
Copy pathrelease-nightly.yaml
File metadata and controls
171 lines (157 loc) · 5.36 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: release-nightly
on:
workflow_dispatch:
schedule:
- cron: "45 0 * * *"
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
permissions:
contents: write
packages: write
id-token: write
attestations: write
jobs:
# Check if the actions already ran in the last 24 hours
# * If yes: Don't run again
# * If no: Clean out existing release assets
prepare-nightly:
runs-on: ubuntu-latest
name: Prepare Nightly Release
outputs:
should-run: ${{ steps.should-run.outputs.should-run }}
# TODO: Re-add
# if: ${{ github.repository == 'gleam-lang/gleam' }}
steps:
- uses: actions/checkout@v6
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should-run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should-run=false" >> $GITHUB_OUTPUT
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
if: ${{ steps.should-run != 'false' }}
with:
token: ${{ github.token }}
tag: nightly
fail-if-no-assets: false
fail-if-no-release: false
assets: |
*.zip
*.tar.gz
*.sha256
*.sha512
*.sigstore
*.sbom.*.json
build-release:
name: build-release
runs-on: ${{ matrix.os }}
environment: release
outputs:
release-id: ${{ steps.release.outputs.id }}
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
toolchain: [ stable ]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
expected-binary-architecture: x86-64
cargo-tool: cross
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
expected-binary-architecture: aarch64
cargo-tool: cross
- os: macos-15-intel
target: x86_64-apple-darwin
expected-binary-architecture: x86_64
cargo-tool: cargo
- os: macos-latest
target: aarch64-apple-darwin
expected-binary-architecture: arm64
cargo-tool: cargo
- os: windows-2022
target: x86_64-pc-windows-msvc
expected-binary-architecture: x86-64
cargo-tool: cargo
- os: windows-11-arm
target: aarch64-pc-windows-msvc
expected-binary-architecture: arm64
cargo-tool: cargo
- os: ubuntu-latest
target: wasm32-unknown-unknown
cargo-tool: wasm-pack
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Update versions
shell: bash
run: ./bin/add-nightly-suffix-to-versions.sh
- name: "Build Archive"
id: build
uses: "./.github/actions/build-release"
with:
version: nightly
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
cargo-tool: ${{ matrix.cargo-tool }}
expected-binary-architecture: ${{ matrix.expected-binary-architecture }}
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-trusted-signing-account-name: ${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
azure-certificate-profile-name: ${{ vars.AZURE_CERTIFICATE_PROFILE_NAME }}
- name: Upload release archive
id: release
# https://github.com/softprops/action-gh-release/issues/445
# uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@f2352b97da0095b4dbbd885a81023e3deabf4fef
with:
draft: false
prerelease: true
fail_on_unmatched_files: true
files: "${{ steps.build.outputs.files }}"
tag_name: nightly
name: "Nightly"
body: |
A build that runs every night following changes to the main branch. Contains all the latest features and changes, but there is a higher chance of instability, bugs, and unfinished features.
The assets are updated but the tag is not, so if you view the commit or download the source from below you will not get the correct code.
build-container-images:
name: build-container-images
needs: [ prepare-nightly, build-release ]
runs-on: ubuntu-latest
if: ${{ needs.prepare-nightly.outputs.should-run != 'false' }}
strategy:
matrix:
base-image:
- scratch
- erlang
- erlang-slim
- erlang-alpine
- elixir
- elixir-slim
- elixir-alpine
- node
- node-slim
- node-alpine
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
sparse-checkout: |
.github/actions
containers
- name: "Build & Push Container"
uses: "./.github/actions/build-container"
with:
version: nightly
release-id: ${{ needs.build-release.outputs.release-id }}