File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1- name : Rust - Build and test
1+ name : Rust - Build, test and publish
22on :
33 push :
44 branches : [ "master" ]
5+ tags : ['v*'] # Triggers when pushing tags starting with 'v'
56 pull_request :
67 branches : [ "master" ]
78
5354 name : ${{ matrix.asset_name }}
5455 path : target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
5556 if-no-files-found : error
57+ publish :
58+ runs-on : ubuntu-latest
59+ if : startsWith(github.ref, 'refs/tags/v')
60+ needs : build
61+ environment : release # Optional: for enhanced security
62+ permissions :
63+ id-token : write # Required for OIDC token exchange
64+ steps :
65+ - uses : actions/checkout@v5
66+ - uses : rust-lang/crates-io-auth-action@v1
67+ id : auth
68+ - run : cargo publish
69+ env :
70+ CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
You can’t perform that action at this time.
0 commit comments