Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ['CI']
types: [completed]
branches: [main]
permissions:
contents: write
packages: write
security-events: write
pull-requests: write
jobs:
check-version:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.version.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: version
env:
BEFORE_SHA: ${{ github.event.workflow_run.head_commit.id }}
run: |
# Prefer GitHub-provided refs when available, fall back to HEAD~1
if [ -n "$BEFORE_SHA" ] && git cat-file -e "${BEFORE_SHA}^" 2>/dev/null; then
BASE="${BEFORE_SHA}~1"
elif git cat-file -e HEAD~1 2>/dev/null; then
BASE="HEAD~1"
else
# Initial commit or unreachable parent — treat as changed
echo "changed=true" >> $GITHUB_OUTPUT
exit 0
fi
if git diff "$BASE" HEAD --name-only | grep -qE 'package\.json$'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
package:
needs: check-version
if: needs.check-version.outputs.changed == 'true'
uses: ./.github/workflows/package.yml
secrets: inherit
container:
needs: check-version
if: needs.check-version.outputs.changed == 'true'
uses: ./.github/workflows/container.yml
secrets: inherit
release:
needs: [check-version, package, container]
if: needs.check-version.outputs.changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Release
uses: wgtechlabs/release-build-flow-action@032b32cb5f6933e5912768c5b2e42c29389c2c95 # v1.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
monorepo: 'true'
workspace-detection: 'true'
package-manager: 'bun'
change-detection: 'both'
unified-version: 'false'
per-package-changelog: 'true'
root-changelog: 'true'
changelog-enabled: 'true'
create-release: 'true'
release-draft: 'false'
release-name-template: 'Release {version}'
exclude-types: 'docs,style,test,ci,build'
minor-keywords: 'feat,new,add'
patch-keywords: 'fix,bugfix,security,perf,setup'
dry-run: 'false'