Skip to content

Update PPA #678

Update PPA

Update PPA #678

Workflow file for this run

name: Update PPA
on:
workflow_run:
workflows: ["Release naisdevice"]
types:
- completed
workflow_dispatch:
jobs:
upload-gar:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Get Latest version
id: latest_version
uses: abatilo/release-info-action@5774bec4e3eabad433b4ae8f625e83afa0e7bb22
with:
owner: nais
repo: device
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }}
service_account: "gh-naisdevice@nais-io.iam.gserviceaccount.com"
token_format: "access_token"
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
install_components: beta
- name: 'Upload new deb file to Google repository'
env:
LATEST: ${{ steps.latest_version.outputs.latest_tag }}
LATEST_DATE: ${{ steps.latest_version.outputs.latest_tag_published_at }}
run: |
echo "Version ${LATEST} was released at ${LATEST_DATE}"
if [[ "${LATEST}" == "null" ]]; then
echo "Invalid version!"
exit 1
fi
# Fetch latest debs
wget https://github.com/nais/device/releases/download/${LATEST}/naisdevice.deb -O naisdevice-${LATEST}.deb
wget https://github.com/nais/device/releases/download/${LATEST}/naisdevice-tenant.deb -O naisdevice-tenant-${LATEST}.deb
# Upload to GAR
gcloud --project nais-io beta artifacts apt upload nais-ppa --quiet --source naisdevice-${LATEST}.deb --location europe-north1
gcloud --project nais-io beta artifacts apt upload nais-ppa --quiet --source naisdevice-tenant-${LATEST}.deb --location europe-north1