Skip to content

Commit f93c9e8

Browse files
authored
chore: setup release-plz (#19)
1 parent 233195a commit f93c9e8

File tree

3 files changed

+67
-24
lines changed

3 files changed

+67
-24
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
# Check for updates to GitHub Actions every week
7+
interval: "weekly"

.github/workflows/publish.yml

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,66 @@
1-
name: Publish Packages
1+
name: Release-plz
2+
23
on:
34
push:
4-
tags:
5-
- "v*.*.*"
5+
branches:
6+
- main
7+
68
jobs:
7-
publish-rust:
8-
runs-on: ubuntu-latest
9+
release-plz-release:
10+
name: Release-plz release
911
environment: release # Optional: for enhanced security
12+
runs-on: ubuntu-latest
13+
if: ${{ github.repository_owner == 'agentclientprotocol' }}
1014
permissions:
11-
contents: read
12-
id-token: write # Required for OIDC token exchange
15+
contents: write
16+
id-token: write
1317
steps:
14-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
15-
- name: Setup Rust
16-
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
18+
- &checkout
19+
name: Checkout repository
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
1721
with:
18-
toolchain: nightly,stable
19-
- name: Check semver
20-
uses: obi1kenobi/cargo-semver-checks-action@5b298c9520f7096a4683c0bd981a7ac5a7e249ae
21-
- uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879
22-
id: auth
23-
- run: cargo publish -p agent-client-protocol
22+
fetch-depth: 0
23+
persist-credentials: false
24+
- &install-rust
25+
name: Install Rust toolchain
26+
uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e
27+
with:
28+
toolchain: stable
29+
- &generate-token
30+
# Generating a GitHub token, so that PRs and tags created by
31+
# the release-plz-action can trigger actions workflows.
32+
name: Generate GitHub token
33+
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94
34+
id: generate-token
35+
with:
36+
# GitHub App ID secret name
37+
app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
38+
# GitHub App private key secret name
39+
private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
40+
- name: Run release-plz
41+
uses: release-plz/action@1efcf74dfcd6e500990dad806e286899ae384064
42+
with:
43+
command: release
2444
env:
25-
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
45+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
2646

27-
release:
47+
release-plz-pr:
48+
name: Release-plz PR
2849
runs-on: ubuntu-latest
29-
needs: [publish-rust]
50+
if: ${{ github.repository_owner == 'agentclientprotocol' }}
3051
permissions:
52+
pull-requests: write
3153
contents: write
54+
concurrency:
55+
group: release-plz-${{ github.ref }}
56+
cancel-in-progress: false
3257
steps:
33-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
34-
- name: Create Release
35-
id: create_release
36-
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090
58+
- *checkout
59+
- *install-rust
60+
- *generate-token
61+
- name: Run release-plz
62+
uses: release-plz/action@1efcf74dfcd6e500990dad806e286899ae384064
3763
with:
38-
draft: true
64+
command: release-pr
65+
env:
66+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

.release-plz.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[workspace]
2+
git_release_type = "auto"
3+
publish = false
4+
5+
[[package]]
6+
name = "agent-client-protocol"
7+
git_tag_name = "v{{ version }}"
8+
publish = true

0 commit comments

Comments
 (0)