Skip to content

chore: add common release workflows and scripts#42

Open
SoulPancake wants to merge 4 commits into
mainfrom
chore/add-common-release-workflows-and-scripts
Open

chore: add common release workflows and scripts#42
SoulPancake wants to merge 4 commits into
mainfrom
chore/add-common-release-workflows-and-scripts

Conversation

@SoulPancake
Copy link
Copy Markdown
Member

Description

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Copilot AI review requested due to automatic review settings June 2, 2026 06:26
@SoulPancake SoulPancake changed the title chore: add cmmon release workflows and scripts chore: add common release workflows and scripts Jun 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh helper (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[@]}"
Comment thread .github/workflows/undraft-release.yml Outdated
workflow_call:

permissions:
contents: write
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you have this be contents: read, and the write can be on the job itself

@SoulPancake SoulPancake requested a review from rhamzeh June 3, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants