beginning go port (#40) #34
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
name: Merge | |
on: | |
push: | |
branches: [ master ] | |
# If `Cargo.toml` is the only file to change, it's probably because this | |
# action bumped the version, and we don't want this action to trigger a new | |
# run of itself creating an infinite loop of version bumps. To solve, we | |
# ignore changes to `Cargo.toml` for the purposes of the merge-to-master | |
# action. | |
paths-ignore: ["Cargo.toml"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v1 # must follow toolchain installation | |
- name: Check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- name: Lint | |
run: cargo clippy -- --deny "warnings" | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v1 # must follow toolchain installation | |
- run: cargo doc --verbose --features fail-on-warnings | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v1 # must follow toolchain installation | |
- name: Run tests | |
run: cargo test --verbose --features fail-on-warnings | |
release: | |
needs: [test, docs, check] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v1 # must follow toolchain installation | |
- name: Bump version | |
run: | | |
set -eo pipefail | |
echo "Installing cargo-bump" | |
cargo install cargo-bump --verbose | |
echo "Updating git identity" | |
git config --global user.email "[email protected]" | |
git config --global user.name "Futhorc Merge Action" | |
echo "Bumping patch version" | |
cargo bump patch --git-tag || true | |
echo "Pushing git tags" | |
git push | |
git push --tags || true | |
- name: build | |
run: | | |
set -eo pipefail | |
cargo build --verbose --features fail-on-warnings --release | |
version="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "futhorc") | .version')" | |
mv target/release/futhorc futhorc-amd64-linux-$version | |
- name: Pre-release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: futhorc-amd64-linux-* | |
- name: Publish | |
env: | |
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} | |
run: cargo login $CARGO_TOKEN && cargo publish --allow-dirty |