Fetch Latest Version #304
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: 'Fetch Latest Version' | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| update-existing-release: | |
| description: 'Force update an existing release' | |
| required: false | |
| default: 'false' | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: write-all | |
| jobs: | |
| fetch-latest: | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 1 | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@main | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| make install_dependencies | |
| - name: Fetch APT repository | |
| run: | | |
| sudo sh -c 'echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list' | |
| wget -qO- https://ftp-master.debian.org/keys/archive-key-12.asc | sudo gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/debian-archive-keyring.gpg > /dev/null | |
| wget -qO- https://ftp-master.debian.org/keys/archive-key-12-security.asc | sudo gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/debian-archive-security-keyring.gpg > /dev/null | |
| sudo apt-get update -qqy | |
| LATEST_VERSION="$(apt-cache policy chromium | grep Candidate | awk '{print $2}')" | |
| echo "LATEST_VERSION=${LATEST_VERSION}" >> $GITHUB_ENV | |
| - name: Update matrix file | |
| run: | | |
| python3 scripts/update_latest.py ${LATEST_VERSION} | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "Happy TestOps Robot" | |
| git commit -m "[ci] Update version ${LATEST_VERSION}" -m "[skip test]" -a || true | |
| git pull --rebase | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.ORG_CI_TOKEN }} | |
| - name: Check if version was archived already | |
| uses: insightsengineering/release-existence-action@main | |
| id: check_release | |
| with: | |
| release-tag: ${{ env.LATEST_VERSION }} | |
| - name: Download deb package | |
| # if: steps.check_release.outputs.release-exists == 'false' || github.event.inputs.update-existing-release == 'true' | |
| run: | | |
| apt download chromium-common chromium chromium-l10n chromium-driver | |
| ls -l *.deb | |
| - name: Archive build as GH release | |
| # if: steps.check_release.outputs.release-exists == 'false' || github.event.inputs.update-existing-release == 'true' | |
| uses: softprops/action-gh-release@master | |
| with: | |
| files: | | |
| *.deb | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_name: ${{ env.LATEST_VERSION }} | |
| name: ${{ env.LATEST_VERSION }} | |
| body: ${{ env.LATEST_VERSION }} | |
| draft: false | |
| prerelease: false |