-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from 0x5c/macroize
Most release boilerplate done
- Loading branch information
Showing
13 changed files
with
868 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "Checks" | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
jobs: | ||
changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dangoslen/changelog-enforcer@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: QA | ||
|
||
on: [push,pull_request] | ||
|
||
jobs: | ||
precheck: | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
# skip concurrent jobs if they are on the same thing | ||
concurrent_skipping: 'same_content' | ||
# never skip PR + manual/scheduled runs | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
|
||
cargocheck: | ||
name: Cargo Check | ||
needs: precheck | ||
if: ${{ needs.precheck.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all-features | ||
|
||
tests: | ||
name: Tests | ||
needs: [precheck, cargocheck] | ||
if: ${{ needs.precheck.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Release | ||
|
||
jobs: | ||
cratesio: | ||
name: Push to crates.io | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- uses: katyo/publish-crates@v1 | ||
with: | ||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
||
github: | ||
name: Publish on GitHub | ||
needs: cratesio | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Get Version Info | ||
id: get_tag | ||
shell: bash | ||
run: | | ||
SUBJECT=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(subject)') | ||
BODY=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(body)' | sed '/-----BEGIN PGP SIGNATURE-----/,$d') | ||
echo "SUBJECT=$SUBJECT" | ||
echo "BODY=$BODY" | ||
echo 'tag_subject<<EOS' >> $GITHUB_ENV | ||
echo "$SUBJECT" >> $GITHUB_ENV | ||
echo 'EOS' >> $GITHUB_ENV | ||
echo 'tag_body<<EOB' >> $GITHUB_ENV | ||
echo "$BODY" >> $GITHUB_ENV | ||
echo 'EOB' >> $GITHUB_ENV | ||
echo "tag_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
echo "version_num=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
- name: Get Changelog Content | ||
id: changelog_reader | ||
uses: mindsers/changelog-reader-action@v2 | ||
with: | ||
version: ${{ env.version_num }} | ||
path: ./CHANGELOG.md | ||
|
||
- name: Publish Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.tag_version }} | ||
release_name: ${{ env.tag_subject }} | ||
body: | | ||
${{ env.tag_body }} | ||
## Changelog | ||
${{ steps.changelog_reader.outputs.changes }} | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.