Skip to content

Commit c983888

Browse files
committed
Revert "Merge 'build: Update cargo-dist to latest' from Pekka Enberg"
This reverts commit 248a369, reversing changes made to e464f99. This is an attempt to fix release process.
1 parent d0b5aca commit c983888

File tree

3 files changed

+51
-58
lines changed

3 files changed

+51
-58
lines changed

.github/workflows/release.yml

+25-35
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
2-
#
31
# Copyright 2022-2024, axodotdev
42
# SPDX-License-Identifier: MIT or Apache-2.0
53
#
64
# CI that:
75
#
86
# * checks for a Git Tag that looks like a release
9-
# * builds artifacts with dist (archives, installers, hashes)
7+
# * builds artifacts with cargo-dist (archives, installers, hashes)
108
# * uploads those artifacts to temporary workflow zip
119
# * on success, uploads the artifacts to a GitHub Release
1210
#
@@ -26,10 +24,10 @@ permissions:
2624
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2725
#
2826
# If PACKAGE_NAME is specified, then the announcement will be for that
29-
# package (erroring out if it doesn't have the given version or isn't dist-able).
27+
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
3028
#
3129
# If PACKAGE_NAME isn't specified, then the announcement will be for all
32-
# (dist-able) packages in the workspace with that version (this mode is
30+
# (cargo-dist-able) packages in the workspace with that version (this mode is
3331
# intended for workspaces with only one dist-able package, or with all dist-able
3432
# packages versioned/released in lockstep).
3533
#
@@ -47,7 +45,7 @@ on:
4745
- '**[0-9]+.[0-9]+.[0-9]+*'
4846

4947
jobs:
50-
# Run 'dist plan' (or host) to determine what tasks we need to do
48+
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
5149
plan:
5250
runs-on: "ubuntu-20.04"
5351
outputs:
@@ -61,25 +59,25 @@ jobs:
6159
- uses: actions/checkout@v4
6260
with:
6361
submodules: recursive
64-
- name: Install dist
62+
- name: Install cargo-dist
6563
# we specify bash to get pipefail; it guards against the `curl` command
6664
# failing. otherwise `sh` won't catch that `curl` returned non-0
6765
shell: bash
68-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.28.0/cargo-dist-installer.sh | sh"
69-
- name: Cache dist
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
67+
- name: Cache cargo-dist
7068
uses: actions/upload-artifact@v4
7169
with:
7270
name: cargo-dist-cache
73-
path: ~/.cargo/bin/dist
71+
path: ~/.cargo/bin/cargo-dist
7472
# sure would be cool if github gave us proper conditionals...
7573
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7674
# functionality based on whether this is a pull_request, and whether it's from a fork.
7775
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7876
# but also really annoying to build CI around when it needs secrets to work right.)
7977
- id: plan
8078
run: |
81-
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
82-
echo "dist ran successfully"
79+
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80+
echo "cargo dist ran successfully"
8381
cat plan-dist-manifest.json
8482
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8583
- name: "Upload dist-manifest.json"
@@ -97,19 +95,18 @@ jobs:
9795
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') }}
9896
strategy:
9997
fail-fast: false
100-
# Target platforms/runners are computed by dist in create-release.
98+
# Target platforms/runners are computed by cargo-dist in create-release.
10199
# Each member of the matrix has the following arguments:
102100
#
103101
# - runner: the github runner
104-
# - dist-args: cli flags to pass to dist
105-
# - install-dist: expression to run to install dist on the runner
102+
# - dist-args: cli flags to pass to cargo dist
103+
# - install-dist: expression to run to install cargo-dist on the runner
106104
#
107105
# Typically there will be:
108106
# - 1 "global" task that builds universal installers
109107
# - N "local" tasks that build each platform's binaries and platform-specific installers
110108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
111109
runs-on: ${{ matrix.runner }}
112-
container: ${{ matrix.container && matrix.container.image || null }}
113110
env:
114111
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115112
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -120,15 +117,8 @@ jobs:
120117
- uses: actions/checkout@v4
121118
with:
122119
submodules: recursive
123-
- name: Install Rust non-interactively if not already installed
124-
if: ${{ matrix.container }}
125-
run: |
126-
if ! command -v cargo > /dev/null 2>&1; then
127-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129-
fi
130-
- name: Install dist
131-
run: ${{ matrix.install_dist.run }}
120+
- name: Install cargo-dist
121+
run: ${{ matrix.install_dist }}
132122
# Get the dist-manifest
133123
- name: Fetch local artifacts
134124
uses: actions/download-artifact@v4
@@ -142,8 +132,8 @@ jobs:
142132
- name: Build artifacts
143133
run: |
144134
# Actually do builds and make zips and whatnot
145-
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146-
echo "dist ran successfully"
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"
147137
- name: Attest
148138
uses: actions/attest-build-provenance@v1
149139
with:
@@ -157,7 +147,7 @@ jobs:
157147
run: |
158148
# Parse out what we just built and upload it to scratch storage
159149
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
160-
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
150+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
161151
echo "EOF" >> "$GITHUB_OUTPUT"
162152
163153
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -182,12 +172,12 @@ jobs:
182172
- uses: actions/checkout@v4
183173
with:
184174
submodules: recursive
185-
- name: Install cached dist
175+
- name: Install cached cargo-dist
186176
uses: actions/download-artifact@v4
187177
with:
188178
name: cargo-dist-cache
189179
path: ~/.cargo/bin/
190-
- run: chmod +x ~/.cargo/bin/dist
180+
- run: chmod +x ~/.cargo/bin/cargo-dist
191181
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
192182
- name: Fetch local artifacts
193183
uses: actions/download-artifact@v4
@@ -198,8 +188,8 @@ jobs:
198188
- id: cargo-dist
199189
shell: bash
200190
run: |
201-
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
202-
echo "dist ran successfully"
191+
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
192+
echo "cargo dist ran successfully"
203193
204194
# Parse out what we just built and upload it to scratch storage
205195
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -231,12 +221,12 @@ jobs:
231221
- uses: actions/checkout@v4
232222
with:
233223
submodules: recursive
234-
- name: Install cached dist
224+
- name: Install cached cargo-dist
235225
uses: actions/download-artifact@v4
236226
with:
237227
name: cargo-dist-cache
238228
path: ~/.cargo/bin/
239-
- run: chmod +x ~/.cargo/bin/dist
229+
- run: chmod +x ~/.cargo/bin/cargo-dist
240230
# Fetch artifacts from scratch-storage
241231
- name: Fetch artifacts
242232
uses: actions/download-artifact@v4
@@ -247,7 +237,7 @@ jobs:
247237
- id: host
248238
shell: bash
249239
run: |
250-
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
240+
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
251241
echo "artifacts uploaded and released successfully"
252242
cat dist-manifest.json
253243
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"

Cargo.toml

+26
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ limbo_time = { path = "extensions/time", version = "0.0.15" }
4343
limbo_uuid = { path = "extensions/uuid", version = "0.0.15" }
4444
limbo_sqlite3_parser = { path = "vendored/sqlite3-parser", version = "0.0.15" }
4545

46+
# Config for 'cargo dist'
47+
[workspace.metadata.dist]
48+
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
49+
cargo-dist-version = "0.21.0"
50+
# CI backends to support
51+
ci = "github"
52+
# The installers to generate for each app
53+
installers = ["shell", "powershell"]
54+
# Target platforms to build apps for (Rust target-triple syntax)
55+
targets = [
56+
"aarch64-apple-darwin",
57+
"x86_64-apple-darwin",
58+
"x86_64-unknown-linux-gnu",
59+
"x86_64-pc-windows-msvc",
60+
]
61+
# Which actions to run on pull requests
62+
pr-run-mode = "plan"
63+
# Path that installers should place binaries in
64+
install-path = "~/.limbo"
65+
# Whether to install an updater program
66+
install-updater = true
67+
# Whether to consider the binaries in a package for distribution (defaults true)
68+
dist = false
69+
# Whether to enable GitHub Attestations
70+
github-attestations = true
71+
4672
[profile.release]
4773
debug = "line-tables-only"
4874
codegen-units = 1

dist-workspace.toml

-23
This file was deleted.

0 commit comments

Comments
 (0)