From df09afe8686e16772d3cf75fd1705c7ef43d4201 Mon Sep 17 00:00:00 2001 From: louis-e <44675238+louis-e@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:19:42 +0100 Subject: [PATCH] Added prerelease workflow --- .github/workflows/prerelease.yml | 92 ++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000..2896757 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -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 }}