Remove lotsa from the Pacman repository #3
Workflow file for this run
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: Remove Packages from the Pacman repository | |
run-name: Remove lotsa from the Pacman repository | |
on: | |
push: | |
env: | |
PACKAGES_TO_REMOVE: "ca-certificates-i686 cyrus-sasl-i686 docbook-xsl-ns-i686 gzip-i686 less-i686 libksba-i686 libksba-devel-i686 libsasl-i686 libsasl-devel-i686 libserf-i686 libserf-devel-i686 libssh2-i686 libssh2-devel-i686 nano-i686 vim-i686 zlib-i686 zlib-devel-i686" | |
PACMANDRYRUN: "true" | |
GPG_OPTIONS: "--batch --yes --no-tty --list-options no-show-photos --verify-options no-show-photos --pinentry-mode loopback" | |
jobs: | |
build: | |
if: github.event.repository.fork != true | |
runs-on: 'windows-latest' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure build | |
shell: bash | |
run: | | |
HOME="${{ runner.temp }}\\home" && | |
echo "HOME=$HOME" >>$GITHUB_ENV && | |
mkdir -p "$HOME" | |
- name: Download Git for Windows SDK | |
uses: git-for-windows/setup-git-for-windows-sdk@v1 | |
with: | |
flavor: build-installers | |
- name: Clone build-extra | |
shell: bash | |
run: git clone --depth 1 --single-branch -b main https://github.com/dscho/build-extra /usr/src/pacman-helper-quick-remove-follow-up | |
- name: Get GPG key(s) | |
timeout-minutes: 5 | |
shell: bash | |
run: | | |
for key in 57759F748D223F034D8BE870BB3AA74136C569BB | |
do | |
gpg $GPG_OPTIONS --recv-keys --batch --yes --keyserver hkp://keyserver.ubuntu.com "$key" && | |
echo "$key:6:" | gpg $GPG_OPTIONS --import-ownertrust || | |
exit 1 | |
done | |
- name: Prepare home directory for GPG signing | |
if: env.GPGKEY != '' | |
shell: bash | |
run: | | |
echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import && | |
mkdir -p "$HOME" && | |
git config --global gpg.program "/usr/src/build-extra/gnupg-with-gpgkey.sh" && | |
info="$(gpg --list-keys --with-colons "${GPGKEY%% *}" | cut -d : -f 1,10 | sed -n '/^uid/{s|uid:||p;q}')" && | |
git config --global user.name "${info% <*}" && | |
git config --global user.email "<${info#*<}" | |
echo "PACKAGER=$info" >>$GITHUB_ENV | |
env: | |
GPGKEY: ${{secrets.GPGKEY}} | |
- uses: actions/create-github-app-token@v1 | |
id: pacman-repo-token | |
with: | |
app-id: ${{ secrets.GH_APP_ID }} | |
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
owner: ${{ github.repository_owner }} | |
repositories: pacman-repo | |
- name: Remove Pacman packages | |
if: env.PACMANDRYRUN == 'true' || env.azure_blobs_token != '' | |
shell: bash | |
env: | |
GPGKEY: ${{secrets.GPGKEY}} | |
azure_blobs_token: ${{secrets.AZURE_BLOBS_TOKEN}} | |
GITHUB_TOKEN: ${{ steps.pacman-repo-token.outputs.token }} | |
run: /usr/src/build-extra/pacman-helper.sh quick_remove ${PACKAGES_TO_REMOVE} | |
- name: Clean up temporary files | |
if: always() | |
shell: bash | |
run: | | |
gpgconf --kill dirmngr && | |
gpgconf --kill gpg-agent && | |
{ rm -rf "$HOME" || echo "Gracefully leaving files undeleted" >&2; } |