Withdraw packages #63
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: Withdraw packages | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Withdraw packages | |
runs-on: ubuntu-16-core | |
permissions: | |
id-token: write | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: chainguard-dev/actions/setup-melange@main | |
- id: auth | |
name: 'Authenticate to Google Cloud' | |
uses: google-github-actions/auth@v0 | |
with: | |
workload_identity_provider: "projects/618116202522/locations/global/workloadIdentityPools/prod-shared-e350/providers/prod-shared-gha" | |
service_account: "[email protected]" | |
- uses: google-github-actions/setup-gcloud@v0 | |
with: | |
project_id: prod-images-c6e5 | |
- run: echo "${{ secrets.MELANGE_RSA }}" > ./wolfi-signing.rsa | |
- run: | | |
sudo mkdir -p /etc/apk/keys | |
sudo cp ./wolfi-signing.rsa.pub /etc/apk/keys/wolfi-signing.rsa.pub | |
- name: 'Delete withdrawn packages' | |
run: | | |
for arch in x86_64 aarch64; do | |
for pkg in $(grep -v '\#' withdrawn-packages.txt); do | |
echo "=> $pkg" | |
gsutil -m rm -f gs://wolfi-production-registry-destination/os/$arch/$pkg || true | |
done | |
done | |
- name: 'Sync public package repository' | |
run: | | |
mkdir "${{ github.workspace }}/packages" | |
gsutil -m rsync -r gs://wolfi-production-registry-destination/os/ "${{ github.workspace }}/packages/" | |
find "${{ github.workspace }}/packages" -print -exec touch \{} \; | |
- name: 'Reconcile Wolfi index' | |
run: | | |
for arch in x86_64 aarch64; do | |
pushd "${{ github.workspace }}/packages/"$arch | |
melange index -o APKINDEX.tar.gz -a $arch *.apk | |
melange sign-index --signing-key="${{ github.workspace }}/wolfi-signing.rsa" APKINDEX.tar.gz | |
gsutil -h "Cache-Control:no-store" cp "${{ github.workspace }}/packages/${arch}/APKINDEX.tar.gz" gs://wolfi-production-registry-destination/os/${arch}/APKINDEX.tar.gz | |
gsutil -h "Cache-Control:no-store" cp "${{ github.workspace }}/packages/${arch}/APKINDEX.json" gs://wolfi-production-registry-destination/os/${arch}/APKINDEX.json | |
popd | |
done |