sneedium2-forgejo/.forgejo/work/build-linux.yml

77 lines
2.6 KiB
YAML

name: Build Firefox on Linux
on:
repository_dispatch:
inputs:
debugger_keyword:
description: "Name of the debugger keyword"
required: false
default: ""
jobs:
build:
runs-on: docker
container:
image: ubuntu:22.04
permissions:
contents: write
steps:
- name: Free up Disk Space
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- name: Bootstrap Mozilla Source
run: |
curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O
python3 bootstrap.py --application-choice=browser --no-interactive
- name: Update Local Source
working-directory: ./mozilla-unified
run: hg up -C central
- name: Initialize `mozconfig`
working-directory: ./mozilla-unified
run: echo "ac_add_options --with-branding=browser/branding/unofficial" > mozconfig
- name: Get foxified profile
working-directory: ./
run: git clone "https://github.com/Sneed-Group/sneedium2-foxified-profile"
- name: Initialize `foxified profile`
working-directory: ./mozilla-unified
run: cp -r ../sneedium2-foxified-profile/ .
- name: Set Release Tag Output
id: release-tag
run: echo "NOW=$(date +'%Y%m%d%H%M%S')" >> $FORGEJO_OUTPUT
- name: Construct New `debugger` Keyword
id: debugger-keyword
run: echo "DEBUGGER_KEYWORD=${{ inputs.debugger_keyword || 'debugger' + steps.release-tag.outputs.NOW }}" >> $FORGEJO_OUTPUT
- name: Replace `debugger` Keyword
working-directory: ./mozilla-unified
run: sed -i 's/MACRO(debugger/MACRO(${ steps.debugger-keyword.outputs.DEBUGGER_KEYWORD })/' ./js/src/frontend/ReservedWords.h
- name: Build and Package
working-directory: ./mozilla-unified
run: |
./mach build
./mach package
- name: Upload Artifacts
run: |
mkdir -p /tmp/artifacts
cp ./mozilla-unified/obj-x86_64-pc-linux-gnu/dist/*.tar* /tmp/artifacts/
curl -X POST -F "file=@/tmp/artifacts/*" https://your-forgejo-instance/api/v1/repositories/{repo_id}/releases/assets
- name: Create Release
run: |
curl -X POST -H "Authorization: token $FORGEJO_TOKEN" \
-d '{"tag_name": "linux-${{ steps.release-tag.outputs.NOW }}", "name": "linux release"}' \
https://your-forgejo-instance/api/v1/repos/{owner}/{repo}/releases