wat #10
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build_and_release: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-pc-windows-gnu | |
os: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: Build | |
if: matrix.os != 'windows-latest' | |
run: cargo build --release --target ${{ matrix.target }} | |
- name: Build for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
rustup target add ${{ matrix.target }} | |
cargo build --release --target ${{ matrix.target }} | |
- name: List Target Directory | |
run: ls -la target | |
- name: Package | |
shell: bash | |
run: | | |
cd target/${{ matrix.target }}/release | |
if [ -f minos-codex* ]; then | |
tar czvf ../../../minos-codex-${{ matrix.target }}.tar.gz minos-codex* | |
else | |
echo "No build files found to package." | |
exit 1 | |
fi | |
cd - | |
- name: Generate SHA256 | |
run: | | |
cd target/${{ matrix.target }}/release | |
if [ -f minos-codex* ]; then | |
sha256sum minos-codex* > ../../../minos-codex-${{ matrix.target }}.sha256 | |
else | |
echo "No build files found for SHA256 generation." | |
exit 1 | |
fi | |
cd - | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
target/${{ matrix.target }}/release/minos-codex-${{ matrix.target }}.tar.gz | |
target/${{ matrix.target }}/release/minos-codex-${{ matrix.target }}.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |