Repository navigation
46 lines (39 loc) · 1.53 KB
/
Copy pathupload.yml
File metadata and controls
46 lines (39 loc) · 1.53 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
name: NSS Upload
on:
workflow_run:
workflows: ["NSS Release"]
types:
- completed
branches:
- main
jobs:
upload:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'refs/tags/NSS_') && endsWith(github.event.workflow_run.head_branch, '_RTM') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install google-cloud-storage
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Upload to GCP
run: |
gcloud storage cp --recursive --no-clobber \
stage/${{ github.event.workflow_run.head_branch }} \
gs://${{ secrets.GCP_PROJECT }}-productdelivery/pub/security/nss/releases/
- name: Verify upload
run: |
gcloud storage ls gs://${{ secrets.GCP_PROJECT }}-productdelivery/pub/security/nss/releases/${{ github.event.workflow_run.head_branch }}/
gcloud storage ls gs://${{ secrets.GCP_PROJECT }}-productdelivery/pub/security/nss/releases/${{ github.event.workflow_run.head_branch }}/src/