Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick: PPA automate release selection #9919

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading