Skip to content

Publish Release

Publish Release #489

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
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.23.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@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
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.23.x
check-latest: true
cache: true
- name: Auth To GCP
uses: google-github-actions/auth@8254fb75a33b976a221574d287e93919e6a36f70
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@f0990588f1e5b5af6827153b93673613abdc6ec7
- name: Upload To Release Bucket
run: gsutil -m rsync -c -r modules/sync gs://buf-modules
- uses: dblock/create-a-github-issue@c5e54b8762a0c4c2cd9330750e30b81bcc369c38
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