-
Notifications
You must be signed in to change notification settings - Fork 12
126 lines (109 loc) · 3.52 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Build and Release
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
target: [linux, windows, macos]
arch: [x86_64, arm64, i686]
exclude:
# Fails (.mozbuild does not include clang++-cl)
- target: windows
arch: arm64
# Unsuported
- target: macos
arch: i686
steps:
- name: Maximize build space
uses: AdityaGarg8/[email protected]
with:
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
remove-cached-tools: "true"
remove-swapfile: "true"
verbose: "false"
- name: Remove unwanted tools
# Originally from here: https://github.com/AdityaGarg8/remove-unwanted-software/blob/master/action.yml
# Modified to keep llvm.
run: |
sudo apt-get remove -y '^aspnetcore-.*' > /dev/null
sudo apt-get remove -y '^dotnet-.*' > /dev/null
sudo apt-get remove -y 'php.*' > /dev/null
sudo apt-get remove -y '^mongodb-.*' > /dev/null
sudo apt-get remove -y '^mysql-.*' > /dev/null
sudo apt-get remove -y azure-cli google-chrome-stable firefox ${POWERSHELL} mono-devel libgl1-mesa-dri --fix-missing > /dev/null
if [[ (${CODENAME} = focal) || (${CODENAME} = jammy) ]]; then
sudo apt-get remove -y google-cloud-sdk --fix-missing > /dev/null
sudo apt-get remove -y google-cloud-cli --fix-missing > /dev/null
fi
sudo apt-get autoremove -y > /dev/null
sudo apt-get clean > /dev/null
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.23"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: ${{ matrix.arch == 'x86_64' && 'x64' || 'any' }}
- name: Check disk space
run: df -h
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y msitools p7zip-full aria2
- name: Setup and bootstrap
run: |
make setup-minimal
make mozbootstrap
mkdir -p dist
- name: Create swap space
run: |
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
- name: Build
run: python3 ./multibuild.py --target ${{ matrix.target }} --arch ${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: CamoufoxBuilds-${{ matrix.target }}-${{ matrix.arch }}
path: dist/*
release:
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/**/*
generate_release_notes: true
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}