-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (48 loc) · 1.92 KB
/
ppa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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: "[email protected]"
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