-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (99 loc) · 4.14 KB
/
Copy pathpublish-agent-install.yml
File metadata and controls
106 lines (99 loc) · 4.14 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Publish agent-install
on:
push:
branches: [main]
paths:
- "agent-install/**"
- ".github/workflows/publish-agent-install.yml"
workflow_dispatch: {}
# Least-privilege at the workflow level. id-token is required for WIF;
# contents: read is enough for actions/checkout.
permissions:
contents: read
id-token: write
# One publish at a time, never cancel an in-flight upload.
concurrency:
group: publish-agent-install
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
strategy:
# Don't let one region's failure abort the others; each target is
# independent (different GCP project + WIF binding + bucket).
fail-fast: false
matrix:
include:
# US prod (existing behavior — unchanged).
- name: us-prod
bucket_name: roboflow-platform-agent-install
project: roboflow-platform
oidc_project_id: "481589474394"
service_account: gha-computer-vision-skills
wif_pool_id: github-actions
# Requiring an environment lets us add manual approval / restrict to
# main via the repo's environment protection rules without touching
# this file. Only US prod has an environment defined today.
environment: agent-install-prod
# EU staging. Depends on roboflow-infra PR #2208, which creates the
# gha-computer-vision-skills SA + WIF binding in roboflow-eu-staging.
# environment is intentionally "" (no gate). Note: referencing a
# non-existent environment does NOT block the job — GitHub auto-creates
# it with no protection rules — so add a protected
# agent-install-eu-staging environment if approval gating is desired.
- name: eu-staging
bucket_name: roboflow-eu-staging-agent-install
project: roboflow-eu-staging
oidc_project_id: "1044450058029"
service_account: gha-computer-vision-skills
wif_pool_id: github-actions
environment: ""
# EU prod. Depends on roboflow-infra PR #2208, which creates the
# gha-computer-vision-skills SA + WIF binding in roboflow-eu-platform.
# No GitHub environment is set (see eu-staging note above).
- name: eu-prod
bucket_name: roboflow-eu-platform-agent-install
project: roboflow-eu-platform
oidc_project_id: "563150022949"
service_account: gha-computer-vision-skills
wif_pool_id: github-actions
environment: ""
name: publish (${{ matrix.name }})
# When matrix.environment is "", GitHub treats this as no environment gate.
environment: ${{ matrix.environment }}
env:
BUCKET_NAME: ${{ matrix.bucket_name }}
PROJECT: ${{ matrix.project }}
OIDC_PROJECT_ID: ${{ matrix.oidc_project_id }}
SERVICE_ACCOUNT: ${{ matrix.service_account }}
WIF_POOL_ID: ${{ matrix.wif_pool_id }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
workload_identity_provider: projects/${{ env.OIDC_PROJECT_ID }}/locations/global/workloadIdentityPools/${{ env.WIF_POOL_ID }}/providers/github
service_account: ${{ env.SERVICE_ACCOUNT }}@${{ env.PROJECT }}.iam.gserviceaccount.com
- name: Upload agent.sh
uses: google-github-actions/upload-cloud-storage@v3
with:
parent: false
path: agent-install/agent.sh
destination: ${{ env.BUCKET_NAME }}/
process_gcloudignore: false
headers: |-
content-type: text/x-shellscript; charset=utf-8
cache-control: no-cache, max-age=0
- name: Upload agent.ps1
uses: google-github-actions/upload-cloud-storage@v3
with:
parent: false
path: agent-install/agent.ps1
destination: ${{ env.BUCKET_NAME }}/
process_gcloudignore: false
headers: |-
content-type: text/plain; charset=utf-8
cache-control: no-cache, max-age=0