update cd #25
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
name: Continuous Deployment | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
publish: | |
name: Publishing for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, ubuntu-latest ] | |
# 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: | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
targets: "x86_64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc" | |
- uses: actions/checkout@v2 | |
- run: cargo build --release --target ${{ matrix.target }} | |
- name: Packaging final binary | |
shell: bash | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip gooseberry${{ matrix.binary_postfix }} | |
tar czvf gooseberry-${{ matrix.artifact_prefix }}.tar.gz gooseberry${{ matrix.binary_postfix }} | |
if [[ ${{ runner.os }} == 'Windows' ]]; then | |
certutil -hashfile gooseberry-${{ matrix.artifact_prefix }}.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > gooseberry-${{ matrix.artifact_prefix }}.sha256 | |
else | |
shasum -a 256 gooseberry-${{ matrix.artifact_prefix }}.tar.gz > gooseberry-${{ matrix.artifact_prefix }}.sha256 | |
fi | |
- name: Releasing assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
target/${{ matrix.target }}/release/gooseberry-${{ matrix.artifact_prefix }}.tar.gz | |
target/${{ matrix.target }}/release/gooseberry-${{ matrix.artifact_prefix }}.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-cargo: | |
name: Publishing to Cargo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo publish --token ${{ secrets.CARGO_API_KEY }} --allow-dirty |