Merge branch release-v0.13.0 #75
Workflow file for this run
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
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Rust CI - Create Release | |
jobs: | |
check: | |
name: Create Release | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
env: | |
CRUNCH_CONFIG_FILENAME: .env.example | |
with: | |
command: test | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
env: | |
CRUNCH_CONFIG_FILENAME: .env.example | |
with: | |
command: build | |
args: --release | |
- name: Generate SHA-256 hash file | |
run: | | |
cd ./target/release | |
sha256sum crunch > crunch.sha256 | |
- name: Get Rustc version | |
id: get_rustc | |
run: echo ::set-output name=rustc::$(rustc -V) | |
- name: Get Tag version | |
id: get_tag | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_tag.outputs.tag }} | |
release_name: Crunch ${{ steps.get_tag.outputs.tag }} | |
body: "Note: This release was built using `${{ steps.get_rustc.outputs.rustc }}`" | |
draft: true | |
prerelease: false | |
- name: Upload crunch binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./target/release/crunch | |
asset_name: crunch | |
asset_content_type: application/octet-stream | |
- name: Upload crunch sha256 | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./target/release/crunch.sha256 | |
asset_name: crunch.sha256 | |
asset_content_type: text/plain | |