Skip to content
Merged
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
30 changes: 27 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ concurrency:
cancel-in-progress: true

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

permissions:
contents: write
id-token: write
pull-requests: write

jobs:
release:
Expand All @@ -40,11 +42,33 @@ jobs:
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
- name: Prepare Release PR Branch
id: release-branch
run: |
branch="release/${GITHUB_REF_NAME}/version-bump-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
git switch -c "$branch"
git push --set-upstream origin "$branch"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
- name: Publish
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email 'tannerlinsley@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
pnpm run cipublish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ github.ref_name }}
TAG: ${{ inputs.tag }}
- name: Open Version Bump Pull Request
run: |
if [[ "$(git rev-list --count "origin/${GITHUB_REF_NAME}..HEAD")" == "0" ]]; then
echo "No version bump commit was created; skipping pull request."
git push origin --delete "$RELEASE_BRANCH"
exit 0
fi

gh pr create \
--base "$GITHUB_REF_NAME" \
--head "$RELEASE_BRANCH" \
--title "release: version packages" \
--body "Automated version bump created after publishing packages."
env:
RELEASE_BRANCH: ${{ steps.release-branch.outputs.branch }}
Loading