name: rc
on:
push:
branches: [ rc ]
jobs:
publish:
name: Publishing for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [stable]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
binary_postfix: ""
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu
binary_postfix: ""
- os: windows-latest
artifact_prefix: windows
target: x86_64-pc-windows-msvc
binary_postfix: ".exe"
steps:
- name: Installing Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Checkout repository
uses: actions/checkout@v2
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.target }}
- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
strip je${{ matrix.binary_postfix }}
tar czvf je-${{ matrix.artifact_prefix }}.tar.gz je${{ matrix.binary_postfix }}
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile je-${{ matrix.artifact_prefix }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > je-${{ matrix.artifact_prefix }}.sha256
else
shasum -a 256 je-${{ matrix.artifact_prefix }}.tar.gz > je-${{ matrix.artifact_prefix }}.sha256
fi
- uses: actions/upload-artifact@v2
with:
name: je-${{ matrix.artifact_prefix }}.tar.gz
path: target/${{ matrix.target }}/release/je-${{ matrix.artifact_prefix }}.tar.gz