mirror of
https://github.com/theryangeary/choose
synced 2024-11-10 05:24:13 +00:00
Add GitHub action to create GitHub release
This commit is contained in:
parent
064efa3fcb
commit
abde65491b
2 changed files with 49 additions and 22 deletions
22
.github/workflows/crates.yml
vendored
22
.github/workflows/crates.yml
vendored
|
@ -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
49
.github/workflows/release.yml
vendored
Normal 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 }}
|
Loading…
Reference in a new issue