Build and Release Flamewolf #28
Workflow file for this run
This file contains hidden or 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 Flamewolf | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
obj-x86_64-pc-linux-gnu | |
obj-x86_64-pc-msvc | |
key: ${{ runner.os }}-python-${{ hashFiles('**/requirements.txt') }} | |
- name: Install dependencies on Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update && sudo apt-get install -y build-essential wget python3 python3-pip libasound2-dev libpulse-dev libpango1.0-dev libxcb1-dev libxcb-shm0-dev libx11-xcb-dev libxrandr-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxfixes-dev libxi-dev nasm ccache zlib1g zlib1g-dev clang llvm lld libgcc-10-dev | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install python --version 3.11 | |
refreshenv | |
- name: Configure WASI (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd /tmp | |
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0-linux.tar.gz | |
tar -xvf wasi-sdk-22.0-linux.tar.gz | |
sudo mv wasi-sdk-22.0 /opt/wasi-sdk | |
sudo mkdir -p /usr/lib/llvm-18/lib/clang/18/lib/wasi | |
sudo ln -s /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi/* /usr/lib/llvm-18/lib/clang/18/lib/wasi/ | |
rm *.tar.gz | |
echo "WASI_SYSROOT=/opt/wasi-sdk/share/wasi-sysroot" >> $GITHUB_ENV | |
echo "WASM_CC=/opt/wasi-sdk/bin/clang" >> $GITHUB_ENV | |
echo "WASM_CXX=/opt/wasi-sdk/bin/clang++" >> $GITHUB_ENV | |
- name: Build Flamewolf (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
CC=clang CXX=clang++ ./mach build | |
sed -i "s/'MOZ_APP_NAME': 'firefox'/'MOZ_APP_NAME': 'flamewolf'/g" obj-x86_64-pc-linux-gnu/config.status | |
CC=clang CXX=clang++ ./mach build | |
./mach package | |
- name: Build Flamewolf (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
./mach.ps1 build | |
(Get-Content obj-x86_64-pc-msvc/config.status).replace("'MOZ_APP_NAME': 'firefox'", "'MOZ_APP_NAME': 'flamewolf'") | Set-Content obj-x86_64-pc-msvc/config.status | |
./mach.ps1 build | |
./mach.ps1 package | |
- name: Upload artifact (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flamewolf-linux | |
path: obj-x86_64-pc-linux-gnu/dist/*.tar.gz | |
- name: Upload artifact (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flamewolf-windows | |
path: obj-x86_64-pc-msvc/dist/*.zip | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: flamewolf-linux | |
path: ./linux | |
- name: Download Windows artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: flamewolf-windows | |
path: ./windows | |
- name: Upload release asset (Linux) | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./linux/*.tar.gz | |
asset_name: flamewolf-linux.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload release asset (Windows) | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./windows/*.zip | |
asset_name: flamewolf-windows.zip | |
asset_content_type: application/zip |