From bd83d7aaa6cb9eb108b67f109af4fb48731eefa0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 22 Apr 2024 23:21:03 +1000 Subject: [PATCH] CI: Support automatic publish to crates.io on tag creation This would make it easier to release new crate, without having to ping anyone. Whoever has the right to create a new release on GitHub shall have the right to publish it to crates.io Signed-off-by: Jiahao XU --- .github/workflows/publish.yml | 15 +++++++++++++++ 1 file changed, 15 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..df23090 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +on: + push: + tags: + - "*" + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Publish to crates.io + run: | + cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}