-
Notifications
You must be signed in to change notification settings - Fork 36
31 lines (28 loc) · 792 Bytes
/
release.yml
File metadata and controls
31 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Create GitHub Release and Publish to crates.io
on:
push:
tags: ['v*']
jobs:
github-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- id: create-release
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: github-release
runs-on: ubuntu-latest
# environment: release # Optional: for enhanced security
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}