From 22502ec707cbd7336d51147069354a9d3356ff91 Mon Sep 17 00:00:00 2001 From: jmic Date: Wed, 21 Aug 2024 22:51:56 +0200 Subject: [PATCH] add publish github workflow --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b0295b9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to crates.io + +on: + push: + tags: + - v* +env: + CARGO_TERM_COLOR: always + +permissions: + contents: write + discussions: write + +jobs: + build-test-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: brndnmtthws/rust-action@v1 + with: + toolchain: stable + - run: cargo build + - run: cargo test + - run: cargo login ${{ secrets.CRATES_IO_TOKEN }} + - run: cargo publish + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: false + prerelease: false + discussion_category_name: General + generate_release_notes: true \ No newline at end of file