Skip to content

Commit

Permalink
Cherry-pick: PPA automate release selection (#9919)
Browse files Browse the repository at this point in the history
* Deprecate Ubuntu/23.10 Mantic Minotaur (#9827)
* Experiment: Attempt to automate PPA release selection (#9828)
* Fix typo in ppa-automation workflow (#9840)
  • Loading branch information
oskirby authored Sep 27, 2024
1 parent 7276e40 commit 903b6bc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/ppa-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 0 additions & 10 deletions taskcluster/kinds/build/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 0 additions & 5 deletions taskcluster/kinds/docker-image/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 903b6bc

Please sign in to comment.