From 0f766c410b0d71cc766aa216e0309c8c44054d3e Mon Sep 17 00:00:00 2001 From: Balthazar Rouberol Date: Sun, 22 May 2022 16:10:03 +0200 Subject: [PATCH] Setup a GH action to publish to crates.io on a new tag --- .github/workflows/release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3239a0f..ac4840a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: env: # (required) GitHub token for creating GitHub Releases. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + # Cross compile the binary to a matrix of targets and # upload the artefacts to the release. upload-assets: @@ -47,4 +47,16 @@ jobs: zip: windows env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_PROFILE_RELEASE_LTO: true \ No newline at end of file + CARGO_PROFILE_RELEASE_LTO: true + + # Publish the released crate to crates.io + publish-to-crates.io: + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v1 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}