File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 11name : Publish
22
33on :
4- release :
5- types : [published]
4+ workflow_dispatch :
5+ inputs :
6+ dry_run :
7+ type : boolean
8+ description : " DryRun release"
9+ required : true
10+ default : false
11+ push_tags :
12+ type : boolean
13+ description : " Push tags to repository"
14+ required : true
15+ default : true
616
717jobs :
818 publish :
1222 id-token : write # Required for OIDC token exchange
1323 steps :
1424 - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
15- - uses : rust-lang/crates-io-auth-action@63a7064947ceca9989005e118db3a5fecdc9259f # v1.0.1
25+ - uses : rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
1626 id : auth
17- - run : cargo publish -vv
27+ - run : cargo publish -vv ${{ inputs.dry_run && '--dry-run' || '' }}
1828 env :
1929 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
30+ - if : ${{ inputs.push_tags }}
31+ run : |
32+ PUBLISHED_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')
33+ git config --global --add safe.directory /github/workspace
34+ git config --global user.name "github-actions[bot]"
35+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
36+ git status
37+ git tag $PUBLISHED_VERSION -m $PUBLISHED_VERSION
38+ git push origin --follow-tags
You can’t perform that action at this time.
0 commit comments