Repository navigation
158 lines (137 loc) · 4.58 KB
/
Copy pathrelease.yml
File metadata and controls
158 lines (137 loc) · 4.58 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
name: Release
on:
pull_request:
paths:
- 'src/**'
- 'clibase/**'
- 'graph/**'
- 'resources/**'
- 'build.mill'
- 'mill'
- 'mill.bat'
- 'build-native.sh'
- 'scripts/check-native.sh'
- '.github/workflows/release.yml'
push:
tags:
- 'v*'
concurrency:
group: native-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
env:
COURSIER_REPOSITORIES: https://repo.maven.apache.org/maven2
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
artifact: scalex-macos-arm64
- os: macos-15-intel
artifact: scalex-macos-x64
- os: ubuntu-24.04
artifact: scalex-linux-x64
- os: windows-2022
artifact: scalex-windows-x64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: graalvm/setup-graalvm@03e8abf916fd0e281b2efe7b2da3378bb0a1d085 # v1
with:
java-version: '24.0.2'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Visual Studio (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0
- name: Build native image
shell: bash
run: ./build-native.sh "${{ matrix.artifact }}"
- name: Check binary version against release tag
if: github.ref_type == 'tag'
shell: bash
env:
ARTIFACT: ${{ matrix.artifact }}
run: |
actual=$("./$ARTIFACT" --version)
actual=${actual%$'\r'}
if [[ "v$actual" != "$GITHUB_REF_NAME" ]]; then
echo "::error::$ARTIFACT reports $actual for release $GITHUB_REF_NAME"
exit 1
fi
- name: Test binary
shell: bash
env:
ARTIFACT: ${{ matrix.artifact }}
run: |
bash scripts/check-native.sh "./$ARTIFACT"
"./$ARTIFACT" --version
"./$ARTIFACT" def WorkspaceIndex --json
"./$ARTIFACT" scaffold test WorkspaceIndex --json
- name: Generate checksum
shell: bash
env:
ARTIFACT: ${{ matrix.artifact }}
run: |
if command -v sha256sum >/dev/null; then
sha256sum "$ARTIFACT" > "$ARTIFACT.sha256"
else
shasum -a 256 "$ARTIFACT" > "$ARTIFACT.sha256"
fi
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
if: github.ref_type == 'tag'
with:
name: ${{ matrix.artifact }}
path: |
${{ matrix.artifact }}
${{ matrix.artifact }}.sha256
release:
if: github.ref_type == 'tag'
permissions:
contents: write
id-token: write
attestations: write
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts
- name: Make binaries executable
run: chmod +x artifacts/*/scalex-macos-* artifacts/*/scalex-linux-*
- name: Generate combined checksums
run: |
for asset in scalex-macos-arm64 scalex-macos-x64 scalex-linux-x64 scalex-windows-x64.exe; do
(cd "artifacts/$asset" && sha256sum --check "$asset.sha256")
cat "artifacts/$asset/$asset.sha256" >> checksums.txt
done
cat checksums.txt
- name: Attest build provenance
uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
with:
subject-path: |
artifacts/*/scalex-macos-arm64
artifacts/*/scalex-macos-x64
artifacts/*/scalex-linux-x64
artifacts/*/scalex-windows-x64.exe
- name: Extract changelog
id: changelog
run: |
VERSION="${GITHUB_REF_NAME#v}"
BODY=$(awk "/^## \[${VERSION}\]/{found=1; next} /^## \[/{if(found) exit} found" CHANGELOG.md)
echo "body<<EOF" >> "$GITHUB_OUTPUT"
echo "$BODY" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Create release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
with:
files: |
artifacts/*/scalex-*
checksums.txt
body: ${{ steps.changelog.outputs.body }}