diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..469ec572bf90 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +env: + CARGO_TERM_COLOR: always + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Publish + run: | + sudo apt-get update && sudo apt-get install --yes sed + VERSION=$(sed --regexp-extended --silent 's/^version = \"(.*)"$/\1/p' Cargo.toml) + [ "$GITHUB_REF_NAME" == "v$VERSION" ] + cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true