-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (85 loc) · 3.24 KB
/
release.yaml
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
name: Publish Release
on:
schedule:
# Fetch PRs are fired every weekday at morning. Do releases in the afternoon.
# At 15:00 EST (20:00 UTC) on every day-of-week from Monday through Friday. https://crontab.guru/#0_20_*_*_1-5
- cron: "0 20 * * 1-5"
workflow_dispatch:
permissions:
contents: write
id-token: write
issues: write
packages: read
jobs:
release:
if: github.repository == 'bufbuild/modules'
runs-on: ubuntu-latest
outputs:
did_release: ${{ steps.release.outputs.did_release }}
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
check-latest: true
cache: true
- name: Create Release
id: release
env:
GITHUB_TOKEN: ${{ github.token }}
run: go run ./cmd/release .
- uses: dblock/create-a-github-issue@866beb009af3db457e82ca98efe474969a5ebce8
if: failure()
env:
GITHUB_TOKEN: ${{ github.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
# sync job is currently syncing the whole sync directory, it runs
# every time, regardless if there was a release or not, or even if the
# release job failed. TODO: We can improve efficiency here by doing
# two things: (1) only triggering sync job when there's a release
# produced from the previous step, and (2) only syncing directories
# (or even files) that changed in the rsync invocation.
sync:
needs: release
environment: production
if: github.repository == 'bufbuild/modules'
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
check-latest: true
cache: true
- name: Auth To GCP
uses: google-github-actions/auth@a6e2e39c0a0331da29f7fd2c2a20a427e8d3ad1f
with:
workload_identity_provider: projects/252484117105/locations/global/workloadIdentityPools/modules-workload-pool/providers/modules-workload-provider
service_account: buf-modules-1-bufbuild-modules@buf-modules-1.iam.gserviceaccount.com
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200
- name: Upload To Release Bucket
run: gsutil -m rsync -c -r modules/sync gs://buf-modules
- uses: dblock/create-a-github-issue@866beb009af3db457e82ca98efe474969a5ebce8
if: failure()
env:
GITHUB_TOKEN: ${{ github.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