chore: add common release workflows and scripts#42
Open
SoulPancake wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a set of reusable GitHub Actions workflows and supporting scripts to standardize the release pipeline across OpenFGA SDK repos (release-please orchestration, post-merge tagging/drafting, undrafting after publish, PR title validation, plus unit-tested parsing helpers).
Changes:
- New reusable workflows:
release-please.yml,undraft-release.yml,pr-title-check.yml. - New
parse-release.shhelper (manifest-diff + changelog-notes extraction) with a Bash test suite and CI workflow. - Supports both single-package SDKs (root
.component) and forward-compatible monorepo-style component manifests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/release-please.yml | Reusable workflow orchestrating release-please PR creation, GPG-signed tagging, and draft GitHub release creation. |
| workflows/undraft-release.yml | Reusable workflow that flips a draft release to published, marking pre-releases when version has a suffix. |
| workflows/pr-title-check.yml | Reusable workflow enforcing Conventional Commit style on PR titles. |
| workflows/scripts/parse-release.sh | Extracted parsing helper for manifest-diff and CHANGELOG note extraction. |
| workflows/scripts/parse-release.test.sh | Bash test suite covering manifest-diff and changelog-notes behavior incl. substring-collision and GH alert preservation. |
| workflows/test-release-scripts.yml | CI workflow running the parse-release test suite on PRs/pushes affecting the script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Run parse-release tests | ||
| run: bash .github/workflows/scripts/parse-release.test.sh |
Comment on lines
+13
to
+20
| bump-type: | ||
| description: > | ||
| Version bump type. Select 'explicit' to supply an exact version via | ||
| the 'release-version' field below. Select 'auto' to let | ||
| conventional-commits determine the bump automatically. | ||
| required: false | ||
| type: string | ||
| default: 'auto' |
Comment on lines
+121
to
+174
| run: | | ||
| BUMP="${{ inputs.bump-type }}" | ||
|
|
||
| if [[ "$BUMP" == "patch" || "$BUMP" == "minor" || "$BUMP" == "major" ]]; then | ||
| CURRENT=$(jq -r '.["."]' .release-please-manifest.json | cut -d'-' -f1) | ||
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | ||
|
|
||
| if [[ "$BUMP" == "major" ]]; then NEXT="$((MAJOR + 1)).0.0" | ||
| elif [[ "$BUMP" == "minor" ]]; then NEXT="${MAJOR}.$((MINOR + 1)).0" | ||
| else NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" | ||
| fi | ||
|
|
||
| echo "value=$NEXT" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "value=" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Import GPG key | ||
| id: import-gpg | ||
| uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 | ||
| with: | ||
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
| git_user_signingkey: true | ||
| git_commit_gpgsign: true | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name openfga-releaser-bot | ||
| git config user.email ${{ steps.import-gpg.outputs.email }} | ||
| git config tag.gpgSign true | ||
|
|
||
| - name: Push Release-As commit | ||
| if: >- | ||
| inputs.trigger-event == 'workflow_dispatch' && ( | ||
| (inputs.bump-type == 'explicit' && inputs.release-version != '') || | ||
| inputs.bump-type == 'patch' || | ||
| inputs.bump-type == 'minor' || | ||
| inputs.bump-type == 'major' | ||
| ) | ||
| run: | | ||
| git checkout release | ||
|
|
||
| if [[ "${{ inputs.bump-type }}" == "explicit" ]]; then | ||
| VERSION="${{ inputs.release-version }}" | ||
| else | ||
| VERSION="${{ steps.compute-release-as.outputs.value }}" | ||
| fi | ||
|
|
||
| git commit --allow-empty \ | ||
| -m "chore: release ${VERSION}" \ | ||
| -m "Release-As: ${VERSION}" | ||
|
|
||
| git push origin release |
Comment on lines
+377
to
+381
| gh release edit "$TAG_NAME" \ | ||
| --repo "$REPO" \ | ||
| --title "$TAG_NAME" \ | ||
| --notes "$NOTES" \ | ||
| --draft "${PRERELEASE_FLAG[@]}" |
4 tasks
rhamzeh
approved these changes
Jun 2, 2026
rhamzeh
requested changes
Jun 2, 2026
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: write |
Member
There was a problem hiding this comment.
Can you have this be contents: read, and the write can be on the job itself
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
main