diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b3dfc93 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish + +on: + release: + types: [created] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install cargo-release + run: cargo install cargo-release + - name: Publish crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: yes | cargo-release release ${{ github.event.release.tag_name }} --execute --no-tag