mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-07 05:22:56 +00:00
## Problem We have a bunch of duplicated code for automated releases. There will be even more, once we have `release-compute` branch (https://github.com/neondatabase/neon/pull/9637). Another issue with the current `release` workflow is that it creates a PR from the main as is. If we create 2 different releases from the same commit, GitHub could mix up results from different PRs. ## Summary of changes - Create a reusable workflow for releases - Create an empty commit to differentiate releases
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Create Release Branch
|
|
|
|
on:
|
|
schedule:
|
|
# It should be kept in sync with if-condition in jobs
|
|
- cron: '0 6 * * MON' # Storage release
|
|
- cron: '0 6 * * THU' # Proxy release
|
|
workflow_dispatch:
|
|
inputs:
|
|
create-storage-release-branch:
|
|
type: boolean
|
|
description: 'Create Storage release PR'
|
|
required: false
|
|
create-proxy-release-branch:
|
|
type: boolean
|
|
description: 'Create Proxy release PR'
|
|
required: false
|
|
|
|
# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
|
|
permissions: {}
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -euo pipefail {0}
|
|
|
|
jobs:
|
|
create-storage-release-branch:
|
|
if: ${{ github.event.schedule == '0 6 * * MON' || format('{0}', inputs.create-storage-release-branch) == 'true' }}
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
uses: ./.github/workflows/_create-release-pr.yml
|
|
with:
|
|
component-name: 'Storage & Compute'
|
|
release-branch: 'release'
|
|
secrets:
|
|
ci-access-token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
create-proxy-release-branch:
|
|
if: ${{ github.event.schedule == '0 6 * * THU' || format('{0}', inputs.create-proxy-release-branch) == 'true' }}
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
uses: ./.github/workflows/_create-release-pr.yml
|
|
with:
|
|
component-name: 'Proxy'
|
|
release-branch: 'release-proxy'
|
|
secrets:
|
|
ci-access-token: ${{ secrets.CI_ACCESS_TOKEN }}
|