Skip to content

Commit

Permalink
Fix tagging release script
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Jan 18, 2024
1 parent f742f84 commit b509995
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
type: string
default: '0.0.0'

dryrun:
description: 'Skip publish (--dry-run)'
required: false
type: boolean
default: false

jobs:
publish:
name: 'Publish on crates.io'
Expand All @@ -17,6 +23,9 @@ jobs:
permissions:
contents: write

env:
TAG: "v${{ inputs.version }}"

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -27,17 +36,18 @@ jobs:

- name: Setup Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- name: Git commit & tag
run: |
git add Cargo.toml
git commit -m "Bump crate version to v${{ inputs.version }}"
git tag "v${{ inputs.version }}"
git commit -m "Bump crate version to ${{ inputs.version }}"
git tag $TAG
- run: cargo publish
- run: cargo publish $SKIP
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
SKIP: ${{ inputs.dryrun && '--dry-run' || '' }}

- run: git push --atomic --follow-tags
- run: git push --atomic origin HEAD $TAG

0 comments on commit b509995

Please sign in to comment.