Skip to content

Commit

Permalink
Release via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Nov 20, 2019
1 parent 7ad3859 commit fbef657
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Clippy

on:
push:
tags-ignore: ["v*"]
paths: ["src/**", "Cargo.toml"]
pull_request:
paths: ["src/**", "Cargo.toml"]
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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, '-') }}
1 change: 1 addition & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Rustfmt

on:
push:
tags-ignore: ["v*"]
paths: ["src/**", ".rustfmt.toml"]
pull_request:
paths: ["src/**", ".rustfmt.toml"]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/security-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Security audit

on:
push:
tags-ignore: ["v*"]
paths: ["Cargo.toml"]
pull_request:
paths: ["Cargo.toml"]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Test

on:
push:
tags-ignore: ["v*"]
paths: ["src/**", "Cargo.toml"]
pull_request:
paths: ["src/**", "Cargo.toml"]
Expand Down

0 comments on commit fbef657

Please sign in to comment.