Build and Release Arnis #13
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: Build and Release Arnis | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
binary_name: arnis.exe | |
asset_name: arnis-windows-x64.exe | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
binary_name: arnis | |
asset_name: arnis-linux-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
targets: ${{ matrix.target }} | |
- name: Install Linux dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install -y software-properties-common | |
sudo add-apt-repository universe | |
echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list | |
sudo apt update | |
sudo apt install -y libgtk-3-dev build-essential pkg-config libglib2.0-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev | |
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: cargo fetch --locked | |
- name: Build | |
run: cargo build --frozen --release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-build | |
path: target/release/${{ matrix.binary_name }} | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Windows build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-latest-build | |
path: ./builds/windows | |
- name: Download Linux build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ubuntu-latest-build | |
path: ./builds/linux | |
- name: Make Linux binary executable | |
run: chmod +x ./builds/linux/arnis | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
builds/windows/arnis.exe | |
builds/linux/arnis | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |