Skip to content

Merge pull request #327 from helium/madninja/fix_pwhash #786

Merge pull request #327 from helium/madninja/fix_pwhash

Merge pull request #327 from helium/madninja/fix_pwhash #786

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: ["v*"]
pull_request:
branches: [master]
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
jobs:
hygiene:
runs-on: ubuntu-latest
steps:
- name: Setup | Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Setup | Tools
run: sudo apt-get install -y protobuf-compiler
- name: Setup | Cache
uses: Swatinem/rust-cache@v2
- name: Build | Hygiene
run: |
cargo fmt -- --check
cargo clippy --all-features --locked -- -D clippy::all
- name: Build | Test
run: |
cargo test
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Setup | Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Tools
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y protobuf-compiler
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install protobuf
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup | Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Build | Compile
run: cargo build --all --locked --release
- name: Build | Name
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
ARCH=x86-64-linux
elif [ "$RUNNER_OS" == "macOS" ]; then
ARCH=x86-64-macos
else
echo "$RUNNER_OS not supported"
exit 1
fi
echo "NAME=helium-wallet-${ARCH}" >> $GITHUB_ENV
- name: Build | Package
shell: bash
run: |
mkdir $NAME
mv target/release/helium-wallet $NAME/
cp README.md $NAME/
cp LICENSE $NAME/
if [ "$RUNNER_OS" == "Linux" ]; then
tar -zcvf $NAME.tar.gz $NAME/
sha256sum -b --tag $NAME.tar.gz > $NAME.checksum
elif [ "$RUNNER_OS" == "macOS" ]; then
gtar -zcvf $NAME.tar.gz $NAME/
shasum -a 256 -b --tag $NAME.tar.gz > $NAME.checksum
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Build | Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}
if-no-files-found: error
path: helium-wallet-*
release:
if: startsWith(github.ref, 'refs/tags')
needs: [hygiene, build]
runs-on: ubuntu-latest
steps:
- name: Setup | Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Setup | Artifacts
uses: actions/download-artifact@v3
with:
path: helium-wallet-*
- name: Release | Artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
name: ${{github.ref_name}}
files: |
**/helium-wallet-*