Check new beta version #794
This file contains 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: Check new beta version | |
on: | |
schedule: | |
- cron: "16 */1 * * *" # Runs this workflow every 3 hours | |
env: | |
LATEST: "" | |
permissions: | |
contents: 'write' | |
jobs: | |
Check-Beta-Version: | |
runs-on: ubuntu-latest | |
outputs: | |
win_tested: ${{ steps.check_latest.outputs.win }} | |
mac_tested: ${{ steps.check_latest.outputs.mac }} | |
steps: | |
- name: Obtain the latest beta version number | |
run: | | |
LATEST=$(curl https://product-details.mozilla.org/1.0/firefox_versions.json | jq '.FIREFOX_DEVEDITION') | |
LATEST=${LATEST:1:-1} | |
echo "LATEST=$LATEST" >> "$GITHUB_ENV" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check if the latest version was tested | |
id: check_latest | |
run: | | |
TESTED_WIN=$(cat ./win-latest-reported-version) | |
if [ "$LATEST" = "$TESTED_WIN" ]; then | |
echo "win=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "win=false" >> "$GITHUB_OUTPUT" | |
fi | |
TESTED_MAC=$(cat ./mac-latest-reported-version) | |
if [ "$LATEST" = "$TESTED_MAC" ]; then | |
echo "mac=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "mac=false" >> "$GITHUB_OUTPUT" | |
fi | |
# Run the beta if the newest version has not been tested | |
Run-Win-Smoke: | |
needs: Check-Beta-Version | |
if: needs.Check-Beta-Version.outputs.win_tested == 'false' | |
uses: ./.github/workflows/smoke.yml | |
with: | |
job_to_run: Smoke-Windows | |
secrets: inherit | |
Run-Mac-Smoke: | |
needs: Check-Beta-Version | |
if: needs.Check-Beta-Version.outputs.mac_tested == 'false' | |
uses: ./.github/workflows/smoke.yml | |
with: | |
job_to_run: Smoke-MacOS | |
secrets: inherit | |