Skip to content

Commit ece9ebf

Browse files
authored
chore: prepare v0.23 release, update dist to 0.11.1 (#1084)
1 parent 52d8b8f commit ece9ebf

2 files changed

Lines changed: 44 additions & 32 deletions

File tree

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

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ permissions:
4040
on:
4141
push:
4242
tags:
43-
- 'libsql-server-**[0-9]+.[0-9]+.[0-9]+*'
43+
- 'libsql-server**[0-9]+.[0-9]+.[0-9]+*'
4444
pull_request:
4545

4646
jobs:
@@ -62,23 +62,23 @@ jobs:
6262
# we specify bash to get pipefail; it guards against the `curl` command
6363
# failing. otherwise `sh` won't catch that `curl` returned non-0
6464
shell: bash
65-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
65+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
6666
# sure would be cool if github gave us proper conditionals...
6767
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6868
# functionality based on whether this is a pull_request, and whether it's from a fork.
6969
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7070
# but also really annoying to build CI around when it needs secrets to work right.)
7171
- id: plan
7272
run: |
73-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > dist-manifest.json
73+
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
7474
echo "cargo dist ran successfully"
75-
cat dist-manifest.json
76-
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
75+
cat plan-dist-manifest.json
76+
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
7777
- name: "Upload dist-manifest.json"
78-
uses: actions/upload-artifact@v3
78+
uses: actions/upload-artifact@v4
7979
with:
80-
name: artifacts
81-
path: dist-manifest.json
80+
name: artifacts-plan-dist-manifest
81+
path: plan-dist-manifest.json
8282

8383
# Build and packages all the platform-specific things
8484
build-local-artifacts:
@@ -113,10 +113,11 @@ jobs:
113113
run: ${{ matrix.install_dist }}
114114
# Get the dist-manifest
115115
- name: Fetch local artifacts
116-
uses: actions/download-artifact@v3
116+
uses: actions/download-artifact@v4
117117
with:
118-
name: artifacts
118+
pattern: artifacts-*
119119
path: target/distrib/
120+
merge-multiple: true
120121
- name: Install dependencies
121122
run: |
122123
${{ matrix.packages_install }}
@@ -139,9 +140,9 @@ jobs:
139140
140141
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
141142
- name: "Upload artifacts"
142-
uses: actions/upload-artifact@v3
143+
uses: actions/upload-artifact@v4
143144
with:
144-
name: artifacts
145+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
145146
path: |
146147
${{ steps.cargo-dist.outputs.paths }}
147148
${{ env.BUILD_MANIFEST_NAME }}
@@ -160,13 +161,15 @@ jobs:
160161
with:
161162
submodules: recursive
162163
- name: Install cargo-dist
163-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
164+
shell: bash
165+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
164166
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
165167
- name: Fetch local artifacts
166-
uses: actions/download-artifact@v3
168+
uses: actions/download-artifact@v4
167169
with:
168-
name: artifacts
170+
pattern: artifacts-*
169171
path: target/distrib/
172+
merge-multiple: true
170173
- id: cargo-dist
171174
shell: bash
172175
run: |
@@ -180,9 +183,9 @@ jobs:
180183
181184
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
182185
- name: "Upload artifacts"
183-
uses: actions/upload-artifact@v3
186+
uses: actions/upload-artifact@v4
184187
with:
185-
name: artifacts
188+
name: artifacts-build-global
186189
path: |
187190
${{ steps.cargo-dist.outputs.paths }}
188191
${{ env.BUILD_MANIFEST_NAME }}
@@ -204,13 +207,14 @@ jobs:
204207
with:
205208
submodules: recursive
206209
- name: Install cargo-dist
207-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
210+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
208211
# Fetch artifacts from scratch-storage
209212
- name: Fetch artifacts
210-
uses: actions/download-artifact@v3
213+
uses: actions/download-artifact@v4
211214
with:
212-
name: artifacts
215+
pattern: artifacts-*
213216
path: target/distrib/
217+
merge-multiple: true
214218
# This is a harmless no-op for Github Releases, hosting for that happens in "announce"
215219
- id: host
216220
shell: bash
@@ -220,9 +224,10 @@ jobs:
220224
cat dist-manifest.json
221225
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
222226
- name: "Upload dist-manifest.json"
223-
uses: actions/upload-artifact@v3
227+
uses: actions/upload-artifact@v4
224228
with:
225-
name: artifacts
229+
# Overwrite the previous copy
230+
name: artifacts-dist-manifest
226231
path: dist-manifest.json
227232

228233
publish-homebrew-formula:
@@ -243,20 +248,24 @@ jobs:
243248
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
244249
# So we have access to the formula
245250
- name: Fetch local artifacts
246-
uses: actions/download-artifact@v3
251+
uses: actions/download-artifact@v4
247252
with:
248-
name: artifacts
253+
pattern: artifacts-*
249254
path: Formula/
255+
merge-multiple: true
256+
# This is extra complex because you can make your Formula name not match your app name
257+
# so we need to find releases with a *.rb file, and publish with that filename.
250258
- name: Commit formula files
251259
run: |
252260
git config --global user.name "${GITHUB_USER}"
253261
git config --global user.email "${GITHUB_EMAIL}"
254262
255-
for release in $(echo "$PLAN" | jq --compact-output '.releases[]'); do
256-
name=$(echo "$release" | jq .app_name --raw-output)
263+
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
264+
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
265+
name=$(echo "$filename" | sed "s/\.rb$//")
257266
version=$(echo "$release" | jq .app_version --raw-output)
258267
259-
git add Formula/${name}.rb
268+
git add "Formula/${filename}"
260269
git commit -m "${name} ${version}"
261270
done
262271
git push
@@ -279,10 +288,11 @@ jobs:
279288
with:
280289
submodules: recursive
281290
- name: "Download Github Artifacts"
282-
uses: actions/download-artifact@v3
291+
uses: actions/download-artifact@v4
283292
with:
284-
name: artifacts
293+
pattern: artifacts-*
285294
path: artifacts
295+
merge-multiple: true
286296
- name: Cleanup
287297
run: |
288298
# Remove the granular manifests

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ rusqlite = { package = "libsql-rusqlite", path = "vendored/rusqlite", version =
4040
# Config for 'cargo dist'
4141
[workspace.metadata.dist]
4242
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
43-
cargo-dist-version = "0.8.2"
43+
cargo-dist-version = "0.11.1"
4444
# CI backends to support
4545
ci = ["github"]
4646
# The installers to generate for each app
4747
installers = ["shell", "homebrew"]
4848
# A GitHub repo to push Homebrew formulas to
4949
tap = "libsql/homebrew-sqld"
50+
# Customize the Homebrew formula name
51+
formula = "sqld"
5052
# Target platforms to build apps for (Rust target-triple syntax)
5153
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
5254
# Publish jobs to run in CI
@@ -55,8 +57,8 @@ publish-jobs = ["homebrew"]
5557
create-release = true
5658
# Publish jobs to run in CI
5759
pr-run-mode = "plan"
58-
# Skip checking whether the specified configuration files are up to date
59-
allow-dirty = ["ci"]
60+
# A prefix git tags must include for cargo-dist to care about them
61+
tag-namespace = "libsql-server"
6062

6163
# The profile that 'cargo dist' will build with
6264
[profile.dist]

0 commit comments

Comments
 (0)