From 0f9fa4aa66a4978df1fcd12fd424f6483596a134 Mon Sep 17 00:00:00 2001 From: Alex Kattathra Johnson Date: Fri, 6 Dec 2024 10:36:52 -0600 Subject: [PATCH] Add github actions Signed-off-by: Alex Kattathra Johnson --- .github/workflows/publish.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..a7f85e0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +on: + push: + tags: + - '*' + +name: Publish + +jobs: + audit: + name: Audit + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/audit@v1 + + crates_io_publish: + name: Publish (crates.io) + needs: + - audit + + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: cargo-release Cache + id: cargo_release_cache + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/cargo-release + key: ${{ runner.os }}-cargo-release + + - run: cargo install cargo-release + if: steps.cargo_release_cache.outputs.cache-hit != 'true' + + - run: cargo package + + - run: cargo release publish --no-confirm --execute --allow-branch HEAD + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file