Skip to content

Publish Release

Publish Release #197

Workflow file for this run

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
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@v4
with:
go-version: 1.21.x
check-latest: true
cache: true
- name: Create Release
id: release
env:
GITHUB_TOKEN: ${{ github.token }}
run: go run ./cmd/release .
# 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@v4
with:
go-version: 1.21.x
check-latest: true
cache: true
- name: Auth To GCP
uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033
with:
workload_identity_provider: projects/252484117105/locations/global/workloadIdentityPools/modules-workload-pool/providers/modules-workload-provider
service_account: buf-modules-1-publisher@buf-modules-1.iam.gserviceaccount.com
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@e30db14379863a8c79331b04a9969f4c1e225e0b
- name: Upload To Release Bucket
run: gsutil rsync -r modules/sync gs://buf-modules