Skip to content

Debian x64 Build

Debian x64 Build #41

name: Debian x64 Build
on: workflow_dispatch
jobs:
build:
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- name: Change PPA mirror servers
run: |
sudo perl -p -i -e 's%(deb(?:-src|)\s+)https?://(?!archive\.canonical\.com|security\.ubuntu\.com)[^\s]+%$1http://archive.ubuntu.com/ubuntu/%' /etc/apt/sources.list
sudo apt update
- name: Setup Disk & Swap Space 💿
if: runner.name == 'ubuntu-latest' || runner.name == 'ubuntu-20.04'
run: |
echo Before:
free -h
df -h
echo
echo
sudo swapoff /mnt/swapfile
sudo rm /mnt/swapfile
sudo fallocate -l 10G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
sudo apt remove -y '^dotnet-.*' '^llvm-.*' '^php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt autoremove -y
sudo apt clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/graalvm
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo fallocate -l 20G /home/runner/swapfile2
sudo chmod 600 /home/runner/swapfile2
sudo mkswap /home/runner/swapfile2
sudo swapon /home/runner/swapfile2
echo
echo
echo After:
free -h
df -h
- name: Create environment 🌲
run: |
sudo apt update
sudo apt install gzip gpg dpkg-dev
export WORKDIR=`pwd`
echo "Current Workdir: $WORKDIR"
git clone https://github.com/floorp-projects/l10n-central.git
./mach bootstrap
echo 'ac_add_options --with-app-name=floorp' >> mozconfig
echo 'ac_add_options --with-app-basename=Floorp' >> mozconfig
echo 'ac_add_options --with-branding=browser/branding/official' >> mozconfig
echo 'ac_add_options --disable-crashreporter' >> mozconfig
echo 'ac_add_options --disable-updater' >> mozconfig
echo 'ac_add_options --enable-proxy-bypass-protection' >> mozconfig
echo 'ac_add_options --disable-verify-mar' >> mozconfig
echo 'ac_add_options --enable-update-channel=release' >> mozconfig
echo 'ac_add_options --with-mozilla-api-keyfile=$PWD/floorp/apis/api-mozilla-key' >> mozconfig
echo 'ac_add_options --with-google-location-service-api-keyfile=$PWD/floorp/apis/api-google-location-service-key' >> mozconfig
echo 'ac_add_options --with-google-safebrowsing-api-keyfile=$PWD/floorp/apis/api-google-safe-browsing-key' >> mozconfig
echo 'ac_add_options --enable-bootstrap' >> mozconfig
echo 'ac_add_options --with-l10n-base=$PWD/l10n-central/l10n-central' >> mozconfig
echo 'ac_add_options --enable-optimize="-O3"' >> mozconfig
echo 'ac_add_options --enable-lto' >> mozconfig
echo 'ac_add_options MOZ_PGO=1' >> mozconfig
echo 'export RUSTC_OPT_LEVEL=2 '>> mozconfig
echo 'export MOZ_INCLUDE_SOURCE_INFO=1' >> mozconfig
echo 'MOZ_REQUIRE_SIGNING=' >> mozconfig
echo 'MOZ_DATA_REPORTING=' >> mozconfig
echo 'MOZ_TELEMETRY_REPORTING=' >> mozconfig
./mach configure
- name: Build 🔨
run: |
rm -rf ./l10n-central/.git
Xvfb :2 -screen 0 1024x768x24 &
export DISPLAY=:2
export WORKDIR=`pwd`
echo "Current Workdir: $WORKDIR"
./mach build
- name: Package 📦
run: |
export MOZ_CHROME_MULTILOCALE="ar cs da de el en-GB en-US es-ES es-MX fr hu id it ja ja-KA ko lt nl nn-NO pl pt-BR pt-PT ru sv-SE th vi zh-CN zh-TW"
for AB_CD in $MOZ_CHROME_MULTILOCALE; do ./mach build chrome-$AB_CD; done
AB_CD=multi ./mach package
export WORKDIR=`pwd`
export DISPVER=`cat browser/config/version_display.txt`
export DEBWORK=$WORKDIR/floorp-$DISPVER
mkdir -p $DEBWORK/usr/lib/
cd $DEBWORK/usr/lib/
mkdir -p floorp-addons/distribution/extensions
mkdir floorp-addons/extensions
mkdir floorp-addons/plugins
tar -xjvf $WORKDIR/obj-x86_64-pc-linux-gnu/dist/floorp-$DISPVER.en-US.linux-x86_64.tar.bz2
cd ..
mkdir bin
cd bin
ln -s ../lib/floorp/floorp.sh floorp
cd ..
mkdir -p share/applications
cp $WORKDIR/.github/floorp-debian.desktop share/applications/floorp.desktop
cd $DEBWORK
cd ../
inst_size=$(du -ks floorp-$DISPVER|awk '{print $1}')
cd $DEBWORK
mkdir DEBIAN
cd DEBIAN
echo -e "Package: floorp\\nVersion: $DISPVER\\nArchitecture: amd64\\nMaintainer: Floorp project\\nInstalled-Size: ${inst_size}\\nDepends: curl, lsb-release, libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.30), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.10.1), libgcc-s1 (>= 3.3), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.42), libgtk-3-0 (>= 3.14), libharfbuzz0b (>= 0.6.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0), libstdc++6 (>= 9), libx11-6, libx11-xcb1 (>= 2:1.6.9), libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.4.5), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxi6, libxrandr2 (>= 2:1.4.0), libxrender1, libxtst6, fonts-noto-cjk\\nRecommends: libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4\\nSuggests: fonts-lyx, fonts-mplus\\nProvides: gnome-www-browser, www-browser\\nSection: web\\nPriority: optional\\nDescription: Floorp is a new Firefox-based, privacy-preserving browser developed by the Japanese student community.\\nXul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}" > control
cd $DEBWORK
unzip $WORKDIR/.github/debian-data-ppa.zip
find $DEBWORK -type f -print0 | xargs -0 chmod 644
find $DEBWORK -type d -print0 | xargs -0 chmod +x
cd DEBIAN
chmod +x postinst postrm preinst prerm
cd ../usr/lib/floorp
chmod +x floorp floorp-bin floorp.sh lib*.so plugin-container gmp-clearkey/0.1/libclearkey.so
sudo chown -R root:root $DEBWORK
cd $WORKDIR
sudo dpkg-deb -b $DEBWORK
- name: Compress artifacts 🤖
run: |
export WORKDIR=`pwd`
export DISPVER=`cat browser/config/version_display.txt`
export DEBWORK=$WORKDIR/floorp-$DISPVER
sudo touch floorp-$DISPVER.deb
sudo chmod +r floorp-$DISPVER.deb
zip -r dist.zip floorp-$DISPVER.deb
- name: Update PPA 👻
run: |
echo "::add-mask::${{ secrets.KEYMASK }}"
export DISPVER=`cat browser/config/version_display.txt`
mkdir publish
echo "${{ secrets.GPG_SEC }}" > Floorp_sec.asc
gpg --import Floorp_sec.asc
echo "${{ secrets.FTP_INIT_SCRIPT }}" > init_script.txt
echo "${{ secrets.FTP_FINISH_SCRIPT }}" > finish_script.txt
cd publish
ftp -n -p < ../init_script.txt
cp ../floorp-$DISPVER.deb ./
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "${{ secrets.GPG_SSB }}" -abs -o - Release > Release.gpg
gpg --default-key "${{ secrets.GPG_SSB }}" --clearsign -o - Release > InRelease
ftp -n -p < ../finish_script.txt
cd ../
rm init_script.txt finish_script.txt Floorp_sec.asc
- name: Publish 🎁
uses: actions/upload-artifact@v1
with:
name: floorp-debian-amd64
path: dist.zip