Build and Release Flamewolf #40
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 Flamewolf | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-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 | |
id: 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: Check for .nocache file | |
id: check-nocache | |
run: | | |
if [ -f .nocache ]; then | |
echo "nocache=true" >> $GITHUB_ENV | |
else | |
echo "nocache=false" >> $GITHUB_ENV | |
fi | |
- name: Install dependencies on Linux | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' && env.nocache == 'false' | |
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 libxi-dev nasm ccache zlib1g zlib1g-dev clang llvm lld libgcc-10-dev libgtk-3-dev libglib2.0-dev | |
- name: Configure WASI (Linux) | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' && env.nocache == 'false' | |
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: steps.cache-dependencies.outputs.cache-hit != 'true' && env.nocache == 'false' | |
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 | |
mv obj-x86_64-pc-linux-gnu/dist/flamewolf*.tar.bz2 obj-x86_64-pc-linux-gnu/dist/flamewolf-linux.tar.bz2 || true | |
- name: Rename files | |
run: | | |
ls -la obj-x86_64-pc-linux-gnu/dist | |
mv obj-x86_64-pc-linux-gnu/dist/flamewolf*.tar.bz2 obj-x86_64-pc-linux-gnu/dist/flamewolf-linux.tar.bz2 || true | |
- name: Upload artifact (Linux) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flamewolf-linux.tar.bz2 | |
path: obj-x86_64-pc-linux-gnu/dist/flamewolf-linux.tar.bz2 | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Ensure artifact exists and rename (Linux) | |
run: | | |
mv obj-x86_64-pc-linux-gnu/dist/flamewolf*.tar.bz2 obj-x86_64-pc-linux-gnu/dist/flamewolf-linux.tar.bz2 || true | |
- name: Upload release asset (Linux) | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: obj-x86_64-pc-linux-gnu/dist/flamewolf-linux.tar.bz2 | |
asset_name: flamewolf-linux.tar.bz2 | |
asset_content_type: application/x-bzip2 |