Linux #219
This file contains hidden or 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: Linux | |
| on: | |
| schedule: | |
| - cron: '30 5 * * 0,3,5' | |
| workflow_dispatch: | |
| inputs: | |
| FORCE_BUILD: | |
| description: 'build forcefully' | |
| required: true | |
| default: '0' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get Firefox version | |
| id: version | |
| run: | | |
| VERSION=$(curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION') | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Check Firefox version | |
| run: | | |
| export FORCE_BUILD="${{ github.event.inputs.FORCE_BUILD }}" | |
| if [ -z "${FORCE_BUILD}" ]; then | |
| FORCE_BUILD=0 | |
| fi | |
| echo "FORCE_BUILD=${FORCE_BUILD}" | |
| if [[ ${FORCE_BUILD} == 1 ]]; then | |
| echo "building..." | |
| fi | |
| export current_ver=$(cat latver) | |
| if [[ ${current_ver} == ${{ steps.version.outputs.version }} && ${FORCE_BUILD} == 0 ]]; then | |
| echo "Already on latest version, aborting..." | |
| exit 1 | |
| else | |
| echo "New release found, building firefox..." | |
| fi | |
| - 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: Install Deps | |
| run: | | |
| sudo apt update | |
| sudo apt install mercurial \ | |
| python3 python3-dev python3-venv \ | |
| curl \ | |
| jq \ | |
| ccache \ | |
| xvfb \ | |
| dbus-x11 \ | |
| libxt6 \ | |
| libx11-xcb-dev \ | |
| libasound2-dev -y | |
| - name: Build | |
| run: | | |
| export DISPLAY=:99 | |
| export deb_pkg=1 | |
| Xvfb $DISPLAY -screen 0 1024x768x24 >/dev/null 2>&1 & bash build.sh | |
| echo ${{ steps.version.outputs.version }} > latver | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add latver | |
| git commit -m "latver: update firefox ver to ${{ steps.version.outputs.version }}" | |
| git push | |
| - name: Set Release Tag Output | |
| id: release-tag | |
| run: echo "NOW=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "./firefox-tree/objdir-opt/dist/firefox*.tar.xz, ./*.deb" | |
| tag: linux-v${{ steps.version.outputs.version }}-${{ steps.release-tag.outputs.NOW }} |