Skip to content

Commit

Permalink
workflows: Add publish crates action
Browse files Browse the repository at this point in the history
  • Loading branch information
0x676e67 committed Jan 16, 2025
1 parent 9bebde7 commit 96be855
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,33 @@ jobs:
- run: cargo check -p rhttp2

crates:
name: Publish crates
runs-on: ubuntu-latest
environment: Linux
needs: [style]
steps:
- uses: actions/checkout@v3

- name: Get tag
if: startsWith(github.ref, 'refs/tags/')
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true

- name: Tag Check
run: |
echo "tag=${{ steps.tag.outputs.tag }}" >> $GITHUB_ENV
echo "tag=${{ steps.tag.outputs.tag }}" >> $GITHUB_OUTPUT
if [ -z "${{ steps.tag.outputs.tag }}" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
echo "tag=latest" >> $GITHUB_ENV
fi
- uses: katyo/publish-crates@v2
if: startsWith(github.ref, 'refs/tags/')
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true

0 comments on commit 96be855

Please sign in to comment.