Skip to content

Commit 475d9f0

Browse files
authored
Update release pipeline (#77)
Move away from manual release steps, and to automated steps.
1 parent fc03c08 commit 475d9f0

8 files changed

+36
-122
lines changed

.github/workflows/create-release.yml

-59
This file was deleted.

.github/workflows/deploy.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
cut-release:
10+
if: ${{ github.actor != 'github-actions[bot]' }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Install cargo-release
19+
run: cargo install cargo-release
20+
21+
- name: Release latest version
22+
run: cargo release --execute --no-confirm patch

.github/workflows/release-plz.yml

-26
This file was deleted.

.github/workflows/release.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ 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.9.0/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.
@@ -161,7 +161,8 @@ jobs:
161161
with:
162162
submodules: recursive
163163
- name: Install cargo-dist
164-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.9.0/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"
165166
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
166167
- name: Fetch local artifacts
167168
uses: actions/download-artifact@v4
@@ -216,7 +217,7 @@ jobs:
216217
with:
217218
submodules: recursive
218219
- name: Install cargo-dist
219-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.9.0/cargo-dist-installer.sh | sh"
220+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
220221
# Fetch artifacts from scratch-storage
221222
- name: Fetch artifacts
222223
uses: actions/download-artifact@v4
@@ -262,16 +263,19 @@ jobs:
262263
pattern: artifacts-*
263264
path: Formula/
264265
merge-multiple: true
266+
# This is extra complex because you can make your Formula name not match your app name
267+
# so we need to find releases with a *.rb file, and publish with that filename.
265268
- name: Commit formula files
266269
run: |
267270
git config --global user.name "${GITHUB_USER}"
268271
git config --global user.email "${GITHUB_EMAIL}"
269272
270-
for release in $(echo "$PLAN" | jq --compact-output '.releases[]'); do
271-
name=$(echo "$release" | jq .app_name --raw-output)
273+
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
274+
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
275+
name=$(echo "$filename" | sed "s/\.rb$//")
272276
version=$(echo "$release" | jq .app_version --raw-output)
273277
274-
git add Formula/${name}.rb
278+
git add "Formula/${filename}"
275279
git commit -m "${name} ${version}"
276280
done
277281
git push

.release-plz.toml

-27
This file was deleted.

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "2"
55
# Config for 'cargo dist'
66
[workspace.metadata.dist]
77
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
8-
cargo-dist-version = "0.9.0"
8+
cargo-dist-version = "0.11.1"
99
# CI backends to support
1010
ci = ["github"]
1111
# The installers to generate for each app
@@ -20,7 +20,7 @@ global-artifacts-jobs = ["./build-linux-pkgs"]
2020
publish-jobs = ["homebrew"]
2121
# Publish jobs to run in CI
2222
pr-run-mode = "plan"
23-
# publish to homebrew
23+
# Whether to publish prereleases to package managers
2424
publish-prereleases = true
2525

2626

scope/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dev-scope"
3-
version = "2024.2.9"
3+
version = "2024.2.12"
44
edition = "2021"
55
default-run = "scope"
66
repository = "https://github.com/ethankhall/scope"

0 commit comments

Comments
 (0)