Add GitHub action to create GitHub release

This commit is contained in:
Ryan Geary 2020-08-16 09:36:40 -04:00
parent 064efa3fcb
commit abde65491b
2 changed files with 49 additions and 22 deletions

View file

@ -1,22 +0,0 @@
name: Crates.io Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check style
run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

49
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: Create Releases
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check style
run: cargo fmt -- --check
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Create GitHub release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ''
draft: false
prerelease: false
- name: Upload binary to GitHub release
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: target/release/choose
asset_name: choose
asset_content_type: application/raw
- name: Create crates.io release
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}