diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 43b189a..1dc622d 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -2,6 +2,7 @@ name: Clippy on: push: + tags-ignore: ["v*"] paths: ["src/**", "Cargo.toml"] pull_request: paths: ["src/**", "Cargo.toml"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ebe150d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: ["v*"] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + ref: ${{ github.ref }} + + - name: Parse release version + id: release + run: | + echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} + + - name: Parse CHANGELOG link + id: changelog + run: | + echo ::set-output name=LINK::https://github.com/${{ github.repository }}/blob/v${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md) + + - name: Verify release version matches Cargo manifest + run: | + test "${{ steps.release.outputs.VERSION }}" == "$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)" + + - name: Release on GitHub + uses: actions/create-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ steps.release.outputs.VERSION }} + body: | + [API Docs](https://docs.rs/tracerr/${{ steps.release.outputs.VERSION }}) + [Changelog](${{ steps.changelog.outputs.LINK }}) + prerelease: ${{ contains(steps.release.outputs.VERSION, '-') }} diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 4ab6876..4e85e78 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -2,6 +2,7 @@ name: Rustfmt on: push: + tags-ignore: ["v*"] paths: ["src/**", ".rustfmt.toml"] pull_request: paths: ["src/**", ".rustfmt.toml"] diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml index e655e6c..1b811a5 100644 --- a/.github/workflows/security-audit.yml +++ b/.github/workflows/security-audit.yml @@ -2,6 +2,7 @@ name: Security audit on: push: + tags-ignore: ["v*"] paths: ["Cargo.toml"] pull_request: paths: ["Cargo.toml"] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4d37af..9b792db 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Test on: push: + tags-ignore: ["v*"] paths: ["src/**", "Cargo.toml"] pull_request: paths: ["src/**", "Cargo.toml"]