diff --git a/.github/workflows/ppa-automation.yaml b/.github/workflows/ppa-automation.yaml index 8e68fe5597..fac11f3e30 100644 --- a/.github/workflows/ppa-automation.yaml +++ b/.github/workflows/ppa-automation.yaml @@ -32,13 +32,29 @@ jobs: sudo apt-get update sudo apt-get install golang debhelper devscripts dput-ng -y - - name: Build source bundle - id: gen-source + - name: Decision + id: decision shell: bash env: GITREF: ${{github.ref}} run: | - ./scripts/linux/script.sh --source --gitref ${GITREF} + git clone --depth 1 -b ubuntu/devel git://git.launchpad.net/ubuntu/+source/distro-info-data + echo -n "releases=" >> $GITHUB_OUTPUT + tail -n+2 distro-info-data/ubuntu.csv | while read -r line; do + IFS=',' read -ra data <<< "$line" + now=$(date +%s) + if [ $(date -d "${data[5]}" +%s) -lt $now ]; then + echo "Ignoring release ${data[2]} -> eol ${data[5]}" + continue # Ignore EOL releases + fi + if [ $(date -d "${data[4]}" +%s) -gt $((now + 5184000)) ]; then + echo "Ignoring release ${data[2]} -> unreleased ${data[4]}" + continue # Ignore releases more than 60 days in the future + fi + echo "Targeting release ${data[2]}" + echo -n "${data[2]} " >> $GITHUB_OUTPUT + done + echo "" >> $GITHUB_OUTPUT if [[ "$GITREF" == "refs/heads/main" ]]; then echo "ppa-url=ppa:okirby/mozilla-vpn-nightly" >> $GITHUB_OUTPUT @@ -50,18 +66,23 @@ jobs: echo "submit-changes=true" >> $GITHUB_OUTPUT fi + - name: Build source bundle + id: gen-source + shell: bash + run: ./scripts/linux/script.sh --source --gitref ${{github.ref}} + - name: Push to Launchpad PPA shell: bash working-directory: .tmp - if: ${{ steps.gen-source.outputs.submit-changes == 'true' }} + if: ${{ steps.decision.outputs.submit-changes == 'true' }} env: DEBEMAIL: ${{ github.actor }}@users.noreply.github.com DEBFULLNAME: ${{ github.actor }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} GNUPGHOME: ${{ runner.temp }}/gnupg-data - PPA_TARGET_DISTS: focal jammy mantic noble - PPA_URL: ${{ steps.gen-source.outputs.ppa-url }} + PPA_TARGET_DISTS: ${{ steps.decision.outputs.releases }} + PPA_URL: ${{ steps.decision.outputs.ppa-url }} run: | mkdir -m700 $GNUPGHOME echo "allow-preset-passphrase" > $GNUPGHOME/gpg-agent.conf diff --git a/taskcluster/kinds/build/linux.yml b/taskcluster/kinds/build/linux.yml index 682ce3e73d..8c69905fff 100644 --- a/taskcluster/kinds/build/linux.yml +++ b/taskcluster/kinds/build/linux.yml @@ -45,16 +45,6 @@ linux/jammy: name: linux-jammy type: build -linux/mantic: - description: "Linux Build (Ubuntu/Mantic)" - treeherder: - platform: linux/mantic - worker: - docker-image: {in-tree: linux-build-mantic} - add-index-routes: - name: linux-mantic - type: build - linux/noble: description: "Linux Build (Ubuntu/Noble)" treeherder: diff --git a/taskcluster/kinds/docker-image/kind.yml b/taskcluster/kinds/docker-image/kind.yml index f42c6a6189..cc74a1746c 100644 --- a/taskcluster/kinds/docker-image/kind.yml +++ b/taskcluster/kinds/docker-image/kind.yml @@ -55,11 +55,6 @@ tasks: definition: linux-dpkg-build args: DOCKER_BASE_IMAGE: ubuntu:jammy - linux-build-mantic: - symbol: I(linux-mantic) - definition: linux-dpkg-build - args: - DOCKER_BASE_IMAGE: ubuntu:mantic linux-build-noble: symbol: I(linux-noble) definition: linux-dpkg-build