Skip to content

Commit a25972b

Browse files
authored
Trusted-publishing (#31)
* Split workflows Signed-off-by: James Sturtevant <[email protected]> * Add trusted publish Signed-off-by: James Sturtevant <[email protected]> --------- Signed-off-by: James Sturtevant <[email protected]>
1 parent d4ca953 commit a25972b

3 files changed

Lines changed: 60 additions & 47 deletions

File tree

.github/workflows/build_and_test.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_call:
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install latest Rust stable toolchain
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
toolchain: stable
23+
- name: Build
24+
run: cargo build --verbose
25+
- name: Run tests
26+
run: cargo test --tests

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
ci:
10+
uses: ./.github/workflows/ci.yaml
11+
12+
release:
13+
name: Publish crate
14+
runs-on: ubuntu-latest
15+
needs: ci
16+
permissions:
17+
id-token: write
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install latest Rust stable toolchain
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: stable
25+
26+
- name: Authenticate with crates.io
27+
uses: rust-lang/crates-io-auth-action@v1
28+
id: crates-io-auth
29+
30+
- name: Cargo publish
31+
run: cargo publish
32+
shell: bash
33+
env:
34+
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}

0 commit comments

Comments
 (0)