-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 2.87 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build and Release Flamewolf
on:
release:
types: [published]
jobs:
build-and-release:
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 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
- name: Rename artifact
run: |
mv obj-x86_64-pc-linux-gnu/dist/flamewolf*.tar.bz2 flamewolf-linux.tar.bz2 || true
- name: Upload artifact and Release (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./flamewolf-linux.tar.bz2
asset_name: flamewolf-linux.tar.bz2
asset_content_type: application/x-bzip2