Skip to content

Commit

Permalink
Merge pull request #270 from louis-e/prerelease-action
Browse files Browse the repository at this point in the history
Added prerelease workflow
  • Loading branch information
louis-e authored Jan 12, 2025
2 parents e9a2329 + df09afe commit ef25c66
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Pre-release Dev Build

on:
push:
branches:
- main

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 }}

prerelease:
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 Pre-release on GitHub
uses: ncipollo/release-action@v1
with:
tag: "dev-build-${{ github.run_number }}"
name: "Dev Build #${{ github.run_number }}"
body: "Automated pre-release for testing purposes. This build may contain experimental features. For the latest official version, please download the latest stable release."
draft: false
prerelease: true
makeLatest: false
files: |
builds/windows/arnis.exe
builds/linux/arnis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ef25c66

Please sign in to comment.