Skip to content

Commit 034aead

Browse files
authored
github: Update Github Actions Ubuntu image to 22.04 (#2039)
20.04 is now gone
2 parents 1e0ce80 + 5006c64 commit 034aead

File tree

3 files changed

+81
-64
lines changed

3 files changed

+81
-64
lines changed

.github/workflows/libsql-server-release.yml

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Copyright 2022-2024, axodotdev
1+
# This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
2+
#
3+
# Copyright 2025 Astral Software Inc.
24
# SPDX-License-Identifier: MIT or Apache-2.0
35
#
46
# CI that:
57
#
68
# * checks for a Git Tag that looks like a release
7-
# * builds artifacts with cargo-dist (archives, installers, hashes)
9+
# * builds artifacts with dist (archives, installers, hashes)
810
# * uploads those artifacts to temporary workflow zip
911
# * on success, uploads the artifacts to a GitHub Release
1012
#
@@ -22,10 +24,10 @@ permissions:
2224
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2325
#
2426
# If PACKAGE_NAME is specified, then the announcement will be for that
25-
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
27+
# package (erroring out if it doesn't have the given version or isn't dist-able).
2628
#
2729
# If PACKAGE_NAME isn't specified, then the announcement will be for all
28-
# (cargo-dist-able) packages in the workspace with that version (this mode is
30+
# (dist-able) packages in the workspace with that version (this mode is
2931
# intended for workspaces with only one dist-able package, or with all dist-able
3032
# packages versioned/released in lockstep).
3133
#
@@ -43,9 +45,9 @@ on:
4345
- 'libsql-server**[0-9]+.[0-9]+.[0-9]+*'
4446

4547
jobs:
46-
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
48+
# Run 'dist plan' (or host) to determine what tasks we need to do
4749
plan:
48-
runs-on: "ubuntu-20.04"
50+
runs-on: "ubuntu-22.04"
4951
outputs:
5052
val: ${{ steps.plan.outputs.manifest }}
5153
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
@@ -57,25 +59,25 @@ jobs:
5759
- uses: actions/checkout@v4
5860
with:
5961
submodules: recursive
60-
- name: Install cargo-dist
62+
- name: Install dist
6163
# we specify bash to get pipefail; it guards against the `curl` command
6264
# failing. otherwise `sh` won't catch that `curl` returned non-0
6365
shell: bash
64-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
65-
- name: Cache cargo-dist
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/cargo-dist/releases/download/v0.28.3/cargo-dist-installer.sh | sh"
67+
- name: Cache dist
6668
uses: actions/upload-artifact@v4
6769
with:
6870
name: cargo-dist-cache
69-
path: ~/.cargo/bin/cargo-dist
71+
path: ~/.cargo/bin/dist
7072
# sure would be cool if github gave us proper conditionals...
7173
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7274
# functionality based on whether this is a pull_request, and whether it's from a fork.
7375
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7476
# but also really annoying to build CI around when it needs secrets to work right.)
7577
- id: plan
7678
run: |
77-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
78-
echo "cargo dist ran successfully"
79+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80+
echo "dist ran successfully"
7981
cat plan-dist-manifest.json
8082
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8183
- name: "Upload dist-manifest.json"
@@ -93,18 +95,19 @@ jobs:
9395
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
9496
strategy:
9597
fail-fast: false
96-
# Target platforms/runners are computed by cargo-dist in create-release.
98+
# Target platforms/runners are computed by dist in create-release.
9799
# Each member of the matrix has the following arguments:
98100
#
99101
# - runner: the github runner
100-
# - dist-args: cli flags to pass to cargo dist
101-
# - install-dist: expression to run to install cargo-dist on the runner
102+
# - dist-args: cli flags to pass to dist
103+
# - install-dist: expression to run to install dist on the runner
102104
#
103105
# Typically there will be:
104106
# - 1 "global" task that builds universal installers
105107
# - N "local" tasks that build each platform's binaries and platform-specific installers
106108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
107109
runs-on: ${{ matrix.runner }}
110+
container: ${{ matrix.container && matrix.container.image || null }}
108111
env:
109112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110113
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -115,10 +118,17 @@ jobs:
115118
- uses: actions/checkout@v4
116119
with:
117120
submodules: recursive
121+
- name: Install Rust non-interactively if not already installed
122+
if: ${{ matrix.container }}
123+
run: |
124+
if ! command -v cargo > /dev/null 2>&1; then
125+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
127+
fi
118128
- name: "Prepare env vars"
119129
run: "echo \"RUSTFLAGS=--cfg tokio_unstable\" >> $GITHUB_ENV"
120-
- name: Install cargo-dist
121-
run: ${{ matrix.install_dist }}
130+
- name: Install dist
131+
run: ${{ matrix.install_dist.run }}
122132
# Get the dist-manifest
123133
- name: Fetch local artifacts
124134
uses: actions/download-artifact@v4
@@ -132,8 +142,8 @@ jobs:
132142
- name: Build artifacts
133143
run: |
134144
# Actually do builds and make zips and whatnot
135-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
136-
echo "cargo dist ran successfully"
145+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146+
echo "dist ran successfully"
137147
- id: cargo-dist
138148
name: Post-build
139149
# We force bash here just because github makes it really hard to get values up
@@ -143,7 +153,7 @@ jobs:
143153
run: |
144154
# Parse out what we just built and upload it to scratch storage
145155
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
146-
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
156+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
147157
echo "EOF" >> "$GITHUB_OUTPUT"
148158
149159
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -160,20 +170,20 @@ jobs:
160170
needs:
161171
- plan
162172
- build-local-artifacts
163-
runs-on: "ubuntu-20.04"
173+
runs-on: "ubuntu-22.04"
164174
env:
165175
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166176
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
167177
steps:
168178
- uses: actions/checkout@v4
169179
with:
170180
submodules: recursive
171-
- name: Install cached cargo-dist
181+
- name: Install cached dist
172182
uses: actions/download-artifact@v4
173183
with:
174184
name: cargo-dist-cache
175185
path: ~/.cargo/bin/
176-
- run: chmod +x ~/.cargo/bin/cargo-dist
186+
- run: chmod +x ~/.cargo/bin/dist
177187
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
178188
- name: Fetch local artifacts
179189
uses: actions/download-artifact@v4
@@ -184,8 +194,8 @@ jobs:
184194
- id: cargo-dist
185195
shell: bash
186196
run: |
187-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
188-
echo "cargo dist ran successfully"
197+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
198+
echo "dist ran successfully"
189199
190200
# Parse out what we just built and upload it to scratch storage
191201
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -210,19 +220,19 @@ jobs:
210220
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
211221
env:
212222
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213-
runs-on: "ubuntu-20.04"
223+
runs-on: "ubuntu-22.04"
214224
outputs:
215225
val: ${{ steps.host.outputs.manifest }}
216226
steps:
217227
- uses: actions/checkout@v4
218228
with:
219229
submodules: recursive
220-
- name: Install cached cargo-dist
230+
- name: Install cached dist
221231
uses: actions/download-artifact@v4
222232
with:
223233
name: cargo-dist-cache
224234
path: ~/.cargo/bin/
225-
- run: chmod +x ~/.cargo/bin/cargo-dist
235+
- run: chmod +x ~/.cargo/bin/dist
226236
# Fetch artifacts from scratch-storage
227237
- name: Fetch artifacts
228238
uses: actions/download-artifact@v4
@@ -233,7 +243,7 @@ jobs:
233243
- id: host
234244
shell: bash
235245
run: |
236-
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
246+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
237247
echo "artifacts uploaded and released successfully"
238248
cat dist-manifest.json
239249
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -270,7 +280,7 @@ jobs:
270280
needs:
271281
- plan
272282
- host
273-
runs-on: "ubuntu-20.04"
283+
runs-on: "ubuntu-22.04"
274284
env:
275285
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
276286
PLAN: ${{ needs.plan.outputs.val }}
@@ -301,6 +311,11 @@ jobs:
301311
name=$(echo "$filename" | sed "s/\.rb$//")
302312
version=$(echo "$release" | jq .app_version --raw-output)
303313
314+
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
315+
brew update
316+
# We avoid reformatting user-provided data such as the app description and homepage.
317+
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
318+
304319
git add "Formula/${filename}"
305320
git commit -m "${name} ${version}"
306321
done
@@ -315,7 +330,7 @@ jobs:
315330
# still allowing individual publish jobs to skip themselves (for prereleases).
316331
# "host" however must run to completion, no skipping allowed!
317332
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
318-
runs-on: "ubuntu-20.04"
333+
runs-on: "ubuntu-22.04"
319334
env:
320335
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
321336
steps:

Cargo.toml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,6 @@ zerocopy = { version = "0.7.32", features = ["derive", "alloc"] }
5353
codegen-units = 1
5454
panic = "unwind"
5555

56-
# Config for 'cargo dist'
57-
[workspace.metadata.dist]
58-
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
59-
cargo-dist-version = "0.21.0"
60-
# CI backends to support
61-
ci = "github"
62-
# The installers to generate for each app
63-
installers = ["shell", "homebrew"]
64-
# A GitHub repo to push Homebrew formulas to
65-
tap = "libsql/homebrew-sqld"
66-
# Customize the Homebrew formula name
67-
formula = "sqld"
68-
# Target platforms to build apps for (Rust target-triple syntax)
69-
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
70-
# Publish jobs to run in CI
71-
publish-jobs = ["homebrew"]
72-
# Whether cargo-dist should create a Github Release or use an existing draft
73-
create-release = true
74-
# Which actions to run on pull requests
75-
pr-run-mode = "plan"
76-
# A prefix git tags must include for cargo-dist to care about them
77-
tag-namespace = "libsql-server"
78-
# Whether to install an updater program
79-
install-updater = false
80-
# additional setup steps
81-
github-build-setup = "../templates/libsql-server-release-build-setup.yml"
82-
# Path that installers should place binaries in
83-
install-path = "CARGO_HOME"
84-
85-
[workspace.metadata.dist.github-custom-runners]
86-
aarch64-apple-darwin = "macos-14"
87-
aarch64-unknown-linux-gnu = "buildjet-8vcpu-ubuntu-2204-arm"
88-
8956
# The profile that 'cargo dist' will build with
9057
[profile.dist]
9158
inherits = "release"

dist-workspace.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[workspace]
2+
members = ["cargo:."]
3+
4+
# Config for 'dist'
5+
[dist]
6+
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7+
cargo-dist-version = "0.28.3"
8+
# CI backends to support
9+
ci = "github"
10+
# The installers to generate for each app
11+
installers = ["shell", "homebrew"]
12+
# A GitHub repo to push Homebrew formulas to
13+
tap = "libsql/homebrew-sqld"
14+
# Customize the Homebrew formula name
15+
formula = "sqld"
16+
# Target platforms to build apps for (Rust target-triple syntax)
17+
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
18+
# Publish jobs to run in CI
19+
publish-jobs = ["homebrew"]
20+
# Whether dist should create a Github Release or use an existing draft
21+
create-release = true
22+
# Which actions to run on pull requests
23+
pr-run-mode = "plan"
24+
# A prefix git tags must include for dist to care about them
25+
tag-namespace = "libsql-server"
26+
# Whether to install an updater program
27+
install-updater = false
28+
# additional setup steps
29+
github-build-setup = "../templates/libsql-server-release-build-setup.yml"
30+
# Path that installers should place binaries in
31+
install-path = "CARGO_HOME"
32+
33+
[github-custom-runners]
34+
aarch64-apple-darwin = "macos-14"
35+
aarch64-unknown-linux-gnu = "buildjet-8vcpu-ubuntu-2204-arm"

0 commit comments

Comments
 (0)