Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions .github/workflows/pkg-go-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,30 @@ jobs:
uses: ./.github/workflows/pkg-go-build.yaml
secrets: inherit

release:
# The release-please post-release job already created a draft GitHub release
# (CHANGELOG notes + auto-generated notes) when it pushed this tag. Go has no
# registry publish step, so once tests pass on the tag we publish (undraft) it.
finalize-release:
runs-on: ubuntu-latest
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
packages: write # publish a new github release
contents: write # publish (undraft) the github release
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^pkg/go/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
prerelease_regex: ^pkg/go/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-(alpha|beta)\.[[:digit:]]+$
changelog_file: pkg/go/CHANGELOG.md
create_draft: true
- name: Publish the draft GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
# The draft is created right after the tag is pushed; wait briefly in
# case this job gets there first.
for _ in $(seq 1 10); do
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
break
fi
echo "Waiting for draft release $TAG ..."
sleep 6
done
gh release edit "$TAG" --repo "$REPO" --draft=false
37 changes: 22 additions & 15 deletions .github/workflows/pkg-java-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,30 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.GPG_PASSPHRASE }}

create-release:
# The release-please post-release job already created a draft GitHub release
# (CHANGELOG notes + auto-generated notes) when it pushed this tag. Publish
# (undraft) it only after both Maven publishes above have succeeded.
finalize-release:
runs-on: ubuntu-latest
needs: [publish-maven-central, publish-github-packages]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
packages: write # publish a new github release
contents: write # publish (undraft) the github release
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0

- name: Create Release
uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^pkg/java/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
prerelease_regex: ^pkg/java/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-(alpha|beta)\.[[:digit:]]+$
changelog_file: pkg/java/CHANGELOG.md
create_draft: true
- name: Publish the draft GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
# The draft is created right after the tag is pushed; wait briefly in
# case this job gets there first.
for _ in $(seq 1 10); do
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
break
fi
echo "Waiting for draft release $TAG ..."
sleep 6
done
gh release edit "$TAG" --repo "$REPO" --draft=false
36 changes: 22 additions & 14 deletions .github/workflows/pkg-js-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,30 @@ jobs:
- name: Publish to npm
run: npx -y npm@11.9.0 publish --tag ${{ steps.npm-tag.outputs.tag }}

release:
# The release-please post-release job already created a draft GitHub release
# (CHANGELOG notes + auto-generated notes) when it pushed this tag. Publish
# (undraft) it only after the npm publish above has succeeded.
finalize-release:
runs-on: ubuntu-latest
needs: [publish]
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
packages: write # publish a new github release
contents: write # publish (undraft) the github release
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0

- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^pkg/js/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
prerelease_regex: ^pkg/js/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-(alpha|beta|rc)\.[[:digit:]]+$
changelog_file: pkg/js/CHANGELOG.md
create_draft: true
- name: Publish the draft GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
# The draft is created right after the tag is pushed; wait briefly in
# case this job gets there first.
for _ in $(seq 1 10); do
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
break
fi
echo "Waiting for draft release $TAG ..."
sleep 6
done
gh release edit "$TAG" --repo "$REPO" --draft=false
60 changes: 60 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release Please

on:
workflow_dispatch:
inputs:
target-package:
description: "Component to target"
type: choice
required: false
default: "all"
options:
- all
- pkg/go
- pkg/js
- pkg/java
bump-type:
description: "Version bump"
type: choice
required: false
default: "auto"
options:
- auto
- patch
- minor
- major
- explicit
release-version:
description: "Explicit version (only used when bump-type=explicit)"
type: string
required: false
default: ""
# Phase 2 (automatic): publish releases when a release commit lands on main.
push:
branches:
- main

permissions:
contents: read

concurrency:
group: release
cancel-in-progress: false

jobs:
release:
uses: ./.github/workflows/reusable-release-please.yaml
permissions:
contents: write
pull-requests: write
with:
trigger-event: ${{ github.event_name == 'workflow_dispatch' && 'workflow_dispatch' || 'push' }}
target-package: ${{ inputs.target-package || 'all' }}
bump-type: ${{ inputs.bump-type || 'auto' }}
release-version: ${{ inputs.release-version || '' }}
secrets:
RELEASER_APP_CLIENT_ID: ${{ secrets.RELEASER_APP_CLIENT_ID }}
RELEASER_APP_PRIVATE_KEY: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

Loading
Loading