Skip to content

Automatic Release Build #7

Automatic Release Build

Automatic Release Build #7

Workflow file for this run

name: Automatic Release Build
on:
release:
types: [published]
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: windows-latest
target: i686-pc-windows-gnu
- os: windows-latest
target: i686-pc-windows-msvc
- os: ubuntu-latest
target: i686-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- if: matrix.os == 'windows-latest'
shell: bash
run: |
echo "OPENSSL_DIR=C:\Program Files\OpenSSL" >> $GITHUB_ENV
- name: Build binary and create archive
shell: bash
run: |
cargo build --verbose --release
archive="meowping-${{ github.event.release.tag_name }}-${{ matrix.target }}"
cd target/release
if [ "${{ matrix.os }}" = "windows-latest" ]; then
asset="$archive.zip"
7z a "../../$asset" "meowping.exe"
else
asset="$archive.tar.gz"
tar czf "../../$asset" "meowping"
fi
cd ../..
echo "ASSET=$asset" >> $GITHUB_ENV
- name: Upload archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh release upload "${{ github.event.release.tag_name }}" ${{ env.ASSET }} --clobber