1
- # This file was autogenerated by cargo- dist: https://opensource.axo.dev/cargo-dist/
1
+ # This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
2
2
#
3
3
# Copyright 2022-2024, axodotdev
4
4
# SPDX-License-Identifier: MIT or Apache-2.0
5
5
#
6
6
# CI that:
7
7
#
8
8
# * checks for a Git Tag that looks like a release
9
- # * builds artifacts with cargo- dist (archives, installers, hashes)
9
+ # * builds artifacts with dist (archives, installers, hashes)
10
10
# * uploads those artifacts to temporary workflow zip
11
11
# * on success, uploads the artifacts to a GitHub Release
12
12
#
@@ -24,10 +24,10 @@ permissions:
24
24
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
25
25
#
26
26
# If PACKAGE_NAME is specified, then the announcement will be for that
27
- # 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).
28
28
#
29
29
# If PACKAGE_NAME isn't specified, then the announcement will be for all
30
- # (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
31
31
# intended for workspaces with only one dist-able package, or with all dist-able
32
32
# packages versioned/released in lockstep).
33
33
#
@@ -39,12 +39,13 @@ permissions:
39
39
# If there's a prerelease-style suffix to the version, then the release(s)
40
40
# will be marked as a prerelease.
41
41
on :
42
+ pull_request :
42
43
push :
43
44
tags :
44
45
- ' **[0-9]+.[0-9]+.[0-9]+*'
45
46
46
47
jobs :
47
- # 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
48
49
plan :
49
50
runs-on : " ubuntu-20.04"
50
51
outputs :
@@ -58,25 +59,25 @@ jobs:
58
59
- uses : actions/checkout@v4
59
60
with :
60
61
submodules : recursive
61
- - name : Install cargo- dist
62
+ - name : Install dist
62
63
# we specify bash to get pipefail; it guards against the `curl` command
63
64
# failing. otherwise `sh` won't catch that `curl` returned non-0
64
65
shell : bash
65
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22 .1/cargo-dist-installer.sh | sh"
66
- - name : Cache cargo- dist
66
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.25 .1/cargo-dist-installer.sh | sh"
67
+ - name : Cache dist
67
68
uses : actions/upload-artifact@v4
68
69
with :
69
70
name : cargo-dist-cache
70
- path : ~/.cargo/bin/cargo- dist
71
+ path : ~/.cargo/bin/dist
71
72
# sure would be cool if github gave us proper conditionals...
72
73
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
73
74
# functionality based on whether this is a pull_request, and whether it's from a fork.
74
75
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
75
76
# but also really annoying to build CI around when it needs secrets to work right.)
76
77
- id : plan
77
78
run : |
78
- cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
79
- 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"
80
81
cat plan-dist-manifest.json
81
82
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
82
83
- name : " Upload dist-manifest.json"
@@ -94,12 +95,12 @@ jobs:
94
95
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') }}
95
96
strategy :
96
97
fail-fast : false
97
- # Target platforms/runners are computed by cargo- dist in create-release.
98
+ # Target platforms/runners are computed by dist in create-release.
98
99
# Each member of the matrix has the following arguments:
99
100
#
100
101
# - runner: the github runner
101
- # - dist-args: cli flags to pass to cargo dist
102
- # - 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
103
104
#
104
105
# Typically there will be:
105
106
# - 1 "global" task that builds universal installers
@@ -116,7 +117,7 @@ jobs:
116
117
- uses : actions/checkout@v4
117
118
with :
118
119
submodules : recursive
119
- - name : Install cargo- dist
120
+ - name : Install dist
120
121
run : ${{ matrix.install_dist }}
121
122
# Get the dist-manifest
122
123
- name : Fetch local artifacts
@@ -131,8 +132,8 @@ jobs:
131
132
- name : Build artifacts
132
133
run : |
133
134
# Actually do builds and make zips and whatnot
134
- cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
135
- echo "cargo dist ran successfully"
135
+ dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
136
+ echo "dist ran successfully"
136
137
- id : cargo-dist
137
138
name : Post-build
138
139
# We force bash here just because github makes it really hard to get values up
@@ -167,12 +168,12 @@ jobs:
167
168
- uses : actions/checkout@v4
168
169
with :
169
170
submodules : recursive
170
- - name : Install cached cargo- dist
171
+ - name : Install cached dist
171
172
uses : actions/download-artifact@v4
172
173
with :
173
174
name : cargo-dist-cache
174
175
path : ~/.cargo/bin/
175
- - run : chmod +x ~/.cargo/bin/cargo- dist
176
+ - run : chmod +x ~/.cargo/bin/dist
176
177
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
177
178
- name : Fetch local artifacts
178
179
uses : actions/download-artifact@v4
@@ -183,8 +184,8 @@ jobs:
183
184
- id : cargo-dist
184
185
shell : bash
185
186
run : |
186
- cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
187
- echo "cargo dist ran successfully"
187
+ dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
188
+ echo "dist ran successfully"
188
189
189
190
# Parse out what we just built and upload it to scratch storage
190
191
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -216,12 +217,12 @@ jobs:
216
217
- uses : actions/checkout@v4
217
218
with :
218
219
submodules : recursive
219
- - name : Install cached cargo- dist
220
+ - name : Install cached dist
220
221
uses : actions/download-artifact@v4
221
222
with :
222
223
name : cargo-dist-cache
223
224
path : ~/.cargo/bin/
224
- - run : chmod +x ~/.cargo/bin/cargo- dist
225
+ - run : chmod +x ~/.cargo/bin/dist
225
226
# Fetch artifacts from scratch-storage
226
227
- name : Fetch artifacts
227
228
uses : actions/download-artifact@v4
@@ -232,7 +233,7 @@ jobs:
232
233
- id : host
233
234
shell : bash
234
235
run : |
235
- cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
236
+ dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
236
237
echo "artifacts uploaded and released successfully"
237
238
cat dist-manifest.json
238
239
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
0 commit comments