Skip to content

Commit b0c6575

Browse files
ci: update workflows (#1)
1 parent ad0db97 commit b0c6575

File tree

3 files changed

+49
-9
lines changed

3 files changed

+49
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Set up Rust toolchain
5656
uses: actions-rust-lang/setup-rust-toolchain@v1
5757
with:
58-
components: clippy, rustfmt, rust-src
58+
components: clippy, rustfmt
5959

6060
- name: Test
61-
run: cargo test --all-features --locked --release
61+
run: cargo test --all-features --all-targets --locked --release

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
name: Publish
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Set up Rust toolchain
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
23+
- name: Install Cargo Binary Install
24+
uses: cargo-bins/cargo-binstall@main
25+
26+
- name: Install crates
27+
run: cargo binstall --force -y cargo-workspaces
28+
29+
- uses: rust-lang/crates-io-auth-action@v1
30+
id: auth
31+
32+
- name: Publish
33+
run: cargo workspaces publish --publish-as-is
34+
env:
35+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
run: git add .
5252

5353
- name: Commit
54+
id: commit
5455
uses: dsanders11/github-app-commit-action@v1
5556
with:
5657
message: ${{ steps.extract-version.outputs.VERSION }}
@@ -60,11 +61,18 @@ jobs:
6061
run: git reset --hard && git pull
6162

6263
- name: Tag
63-
uses: bruno-fs/repo-tagger@1.0.0
64-
with:
65-
tag: ${{ steps.extract-version.outputs.VERSION }}
64+
uses: actions/github-script@v8
6665
env:
67-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
66+
GIT_TAG: ${{ steps.extract-version.outputs.VERSION }}
67+
GIT_SHA: ${{ steps.commit.outputs.sha }}
68+
with:
69+
script: |
70+
github.rest.git.createRef({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
ref: `refs/tags/${process.env.GIT_TAG}`,
74+
sha: process.env.GIT_SHA
75+
})
6876
6977
- name: Release
7078
uses: softprops/action-gh-release@v2
@@ -73,6 +81,3 @@ jobs:
7381
make_latest: true
7482
tag_name: ${{ steps.extract-version.outputs.VERSION }}
7583
token: ${{ steps.app-token.outputs.token }}
76-
77-
- name: Publish
78-
run: cargo workspaces publish --publish-as-is --token "${{ secrets.CRATES_IO_TOKEN }}"

0 commit comments

Comments
 (0)