-
Notifications
You must be signed in to change notification settings - Fork 23
73 lines (70 loc) · 2.72 KB
/
upload.yml
File metadata and controls
73 lines (70 loc) · 2.72 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
name: Upload to GCS
on:
workflow_call:
inputs:
since:
description: 'Upload plugins created or modified since this time (Go duration syntax)'
default: '24h'
required: false
type: string
workflow_dispatch:
inputs:
since:
description: 'Upload plugins created or modified since this time (Go duration syntax)'
default: '24h'
required: false
type: string
permissions:
contents: read
id-token: write
issues: write
jobs:
release:
environment: production
if: github.repository == 'bufbuild/plugins'
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
check-latest: true
# uses https://cloud.google.com/iam/docs/workload-identity-federation to
# swap a GitHub OIDC token for GCP service account credentials, allowing
# this workflow to manage the buf-plugins bucket
- name: Auth To GCP
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
workload_identity_provider: projects/491113660045/locations/global/workloadIdentityPools/plugins-workload-pool/providers/plugins-workload-provider
service_account: buf-plugins-1-bufbuild-plugins@buf-plugins-1.iam.gserviceaccount.com
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
- name: Download Plugins
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
go run ./cmd/download-plugins -since ${{ inputs.since }} downloads
- name: Upload To Release Bucket
run: gsutil -m rsync -r downloads gs://buf-plugins
- name: Generate Github Token
id: generate_issues_token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
if: ${{ failure() }}
with:
app-id: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_ID }}
private-key: ${{ secrets.BUFBUILD_ISSUE_CREATOR_APP_KEY }}
permission-issues: write
- uses: dblock/create-a-github-issue@d10508ebcd7fbef05990c86355a17763cd29aa93 # v3.3.0
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
GITHUB_SERVER_URL: ${ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
with:
filename: .github/automatic-workflow-issue-template.md
update_existing: true
search_existing: open