Skip to content

Commit 9815ef0

Browse files
committed
chore: tidy up release procedure
1 parent f5130a8 commit 9815ef0

File tree

4 files changed

+134
-10
lines changed

4 files changed

+134
-10
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
1+
# This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
22
#
33
# Copyright 2022-2024, axodotdev
44
# SPDX-License-Identifier: MIT or Apache-2.0
@@ -58,12 +58,13 @@ jobs:
5858
steps:
5959
- uses: actions/checkout@v4
6060
with:
61+
persist-credentials: false
6162
submodules: recursive
6263
- name: Install dist
6364
# we specify bash to get pipefail; it guards against the `curl` command
6465
# failing. otherwise `sh` won't catch that `curl` returned non-0
6566
shell: bash
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+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.29.0/cargo-dist-installer.sh | sh"
6768
- name: Cache dist
6869
uses: actions/upload-artifact@v4
6970
with:
@@ -107,6 +108,7 @@ jobs:
107108
# - N "local" tasks that build each platform's binaries and platform-specific installers
108109
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109110
runs-on: ${{ matrix.runner }}
111+
container: ${{ matrix.container && matrix.container.image || null }}
110112
env:
111113
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112114
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -116,9 +118,17 @@ jobs:
116118
git config --global core.longpaths true
117119
- uses: actions/checkout@v4
118120
with:
121+
persist-credentials: false
119122
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
120130
- name: Install dist
121-
run: ${{ matrix.install_dist }}
131+
run: ${{ matrix.install_dist.run }}
122132
# Get the dist-manifest
123133
- name: Fetch local artifacts
124134
uses: actions/download-artifact@v4
@@ -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"
@@ -167,6 +177,7 @@ jobs:
167177
steps:
168178
- uses: actions/checkout@v4
169179
with:
180+
persist-credentials: false
170181
submodules: recursive
171182
- name: Install cached dist
172183
uses: actions/download-artifact@v4
@@ -216,6 +227,7 @@ jobs:
216227
steps:
217228
- uses: actions/checkout@v4
218229
with:
230+
persist-credentials: false
219231
submodules: recursive
220232
- name: Install cached dist
221233
uses: actions/download-artifact@v4
@@ -280,6 +292,7 @@ jobs:
280292
steps:
281293
- uses: actions/checkout@v4
282294
with:
295+
persist-credentials: true
283296
repository: "txpipe/homebrew-tap"
284297
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
285298
# So we have access to the formula
@@ -326,4 +339,5 @@ jobs:
326339
steps:
327340
- uses: actions/checkout@v4
328341
with:
342+
persist-credentials: false
329343
submodules: recursive

Cargo.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ homepage = "https://github.com/txpipe/oura"
88
documentation = "https://docs.rs/oura"
99
license = "Apache-2.0"
1010
readme = "README.md"
11-
authors = ["Santiago Carmuega <santiago@carmuega.me>"]
11+
authors = ["TxPipe <hello@txpipe.io>"]
1212

1313
[features]
1414
wasm = ["extism"]
1515
aws = ["aws-config", "aws-types", "aws-sdk-sqs", "aws-sdk-lambda", "aws-sdk-s3"]
1616
sql = ["sqlx"]
17-
gcp = ["google-cloud-pubsub", "google-cloud-googleapis", "jsonwebtoken"]
17+
gcp = ["google-cloud-pubsub", "google-cloud-googleapis", "jsonwebtoken"]
1818
rabbitmq = ["lapin"]
1919
zeromq = ["zmq"]
2020
u5c = ["utxorpc", "futures"]
@@ -50,7 +50,7 @@ unicode-truncate = "0.2.0"
5050
thiserror = "1.0.39"
5151
indicatif = "0.17.8"
5252
tracing = "0.1.37"
53-
tracing-subscriber = {version = "0.3.18", features = ["env-filter"]}
53+
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
5454
anyhow = "1.0.77"
5555
file-rotate = { version = "0.7.5" }
5656
reqwest = { version = "0.11", features = ["json", "multipart"] }
@@ -92,3 +92,10 @@ port-selector = "0.1.6"
9292
[profile.dist]
9393
inherits = "release"
9494
lto = "thin"
95+
96+
[workspace.metadata.release]
97+
push = false
98+
publish = false
99+
tag-name = "v{{version}}"
100+
pre-release-commit-message = "release: v{{version}}"
101+
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}"]

cliff.toml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
5+
[changelog]
6+
# A Tera template to be rendered as the changelog's footer.
7+
# See https://keats.github.io/tera/docs/#introduction
8+
header = """
9+
# Changelog\n
10+
All notable changes to this project will be documented in this file.\n
11+
"""
12+
# A Tera template to be rendered for each release in the changelog.
13+
# See https://keats.github.io/tera/docs/#introduction
14+
body = """
15+
{% if version %}\
16+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
17+
{% else %}\
18+
## [unreleased]
19+
{% endif %}\
20+
{% for group, commits in commits | group_by(attribute="group") %}
21+
### {{ group | striptags | trim | upper_first }}
22+
{% for commit in commits %}
23+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
24+
{% if commit.breaking %}[**breaking**] {% endif %}\
25+
{{ commit.message | upper_first }}\
26+
{% endfor %}
27+
{% endfor %}\n
28+
"""
29+
# A Tera template to be rendered as the changelog's footer.
30+
# See https://keats.github.io/tera/docs/#introduction
31+
footer = """
32+
<!-- generated by git-cliff -->
33+
"""
34+
# Remove leading and trailing whitespaces from the changelog's body.
35+
trim = true
36+
# Render body even when there are no releases to process.
37+
render_always = true
38+
# An array of regex based postprocessors to modify the changelog.
39+
postprocessors = [
40+
# Replace the placeholder <REPO> with a URL.
41+
#{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" },
42+
]
43+
# render body even when there are no releases to process
44+
# render_always = true
45+
# output file path
46+
# output = "test.md"
47+
48+
[git]
49+
# Parse commits according to the conventional commits specification.
50+
# See https://www.conventionalcommits.org
51+
conventional_commits = true
52+
# Exclude commits that do not match the conventional commits specification.
53+
filter_unconventional = true
54+
# Require all commits to be conventional.
55+
# Takes precedence over filter_unconventional.
56+
require_conventional = false
57+
# Split commits on newlines, treating each line as an individual commit.
58+
split_commits = false
59+
# An array of regex based parsers to modify commit messages prior to further processing.
60+
commit_preprocessors = [
61+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
62+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
63+
# Check spelling of the commit message using https://github.com/crate-ci/typos.
64+
# If the spelling is incorrect, it will be fixed automatically.
65+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
66+
]
67+
# Prevent commits that are breaking from being excluded by commit parsers.
68+
protect_breaking_commits = false
69+
# An array of regex based parsers for extracting data from the commit message.
70+
# Assigns commits to groups.
71+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
72+
commit_parsers = [
73+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
74+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
75+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
76+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
77+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
78+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
79+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
80+
{ message = "^chore\\(release\\): prepare for", skip = true },
81+
{ message = "^chore\\(deps.*\\)", skip = true },
82+
{ message = "^chore\\(pr\\)", skip = true },
83+
{ message = "^chore\\(pull\\)", skip = true },
84+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
85+
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
86+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
87+
{ message = ".*", group = "<!-- 10 -->💼 Other" },
88+
]
89+
# Exclude commits that are not matched by any commit parser.
90+
filter_commits = false
91+
# An array of link parsers for extracting external references, and turning them into URLs, using regex.
92+
link_parsers = []
93+
# Include only the tags that belong to the current branch.
94+
use_branch_tags = false
95+
# Order releases topologically instead of chronologically.
96+
topo_order = false
97+
# Order releases topologically instead of chronologically.
98+
topo_order_commits = true
99+
# Order of commits in each group/release within the changelog.
100+
# Allowed values: newest, oldest
101+
sort_commits = "oldest"
102+
# Process submodules commits
103+
recurse_submodules = false

dist-workspace.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ members = ["cargo:."]
44
# Config for 'dist'
55
[dist]
66
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7-
cargo-dist-version = "0.25.1"
7+
cargo-dist-version = "0.29.0"
88
# CI backends to support
99
ci = "github"
1010
# The installers to generate for each app
11-
installers = ["shell", "homebrew"]
11+
installers = ["shell", "powershell", "homebrew"]
1212
# Target platforms to build apps for (Rust target-triple syntax)
13-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
13+
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
1414
# Path that installers should place binaries in
1515
install-path = "CARGO_HOME"
1616
# Whether to install an updater program

0 commit comments

Comments
 (0)