Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/scripts/create-pr-for-release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async ( {
- [ ] The changelog is correct.
## Next steps
1. Approve this PR to allow [the next workflow creates a new release](${ workflowBaseUrl }/${ createReleaseWorkflow }).
1. Merge this PR after the new release is successfully created and [the version tags are updated](${ workflowBaseUrl }/${ releaseWorkflow }).
1. After the new release is successfully created, [the release workflow](${ workflowBaseUrl }/${ releaseWorkflow }) will update the version tags and merge this PR automatically.
---
${ heading }
${ content }`;
Expand Down
19 changes: 16 additions & 3 deletions .github/scripts/github-actions-create-and-commit-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

# The value of TAG_NAME and the content composited from it are described in terms of
# the official release build. When creating a test build, a branch name is passed in,
Expand All @@ -8,6 +9,16 @@ REPO_URL=$1
TAG_NAME=$2
SOURCE_SHA=$(git rev-parse HEAD)

TMP_BRANCH="tmp-gha-release-build"
TMP_BRANCH_PUSHED=false

cleanup() {
if [ "$TMP_BRANCH_PUSHED" = true ]; then
git push -d origin "$TMP_BRANCH" 2>/dev/null || true
fi
}
trap cleanup EXIT

# To build all actions:

pushd ./packages/github-actions
Expand Down Expand Up @@ -63,7 +74,9 @@ git add README.md
## 7. Complete the build for release or test.
git commit -q --amend -C HEAD

# The temporary `tmp-gha-release-build` branch is only for pushing to the remote repo.
# The temporary branch is only for pushing to the remote repo.
# Tagging it with a version tag will be proceeded with a separate step.
git push origin HEAD:refs/heads/tmp-gha-release-build
git push -d origin tmp-gha-release-build
git push origin "HEAD:refs/heads/$TMP_BRANCH"
TMP_BRANCH_PUSHED=true
git push -d origin "$TMP_BRANCH"
TMP_BRANCH_PUSHED=false
Comment thread
eason9487 marked this conversation as resolved.
Outdated
18 changes: 18 additions & 0 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,21 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.commit-build.outputs.sha }}
release: ${{ needs.Setup.outputs.release }}

MergeReleasePR:
name: Merge Release PR
if: ${{ github.event_name == 'workflow_run' }}
needs: UpdateTags
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Merge the release PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr merge "${{ github.event.workflow_run.head_branch }}" \
--repo "${{ github.repository }}" \
--merge \
--delete-branch
Comment thread
eason9487 marked this conversation as resolved.
5 changes: 2 additions & 3 deletions packages/github-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ Branch off from the old version, set the merge base for fixing PR to be the same
1. :technologist: If it's all good, approve the release PR to proceed with the next workflow.
1. :octocat: Once the release PR is approved, a workflow will create a new release with a new version tag.
- Workflow [GitHub Actions - Create Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-create-release.yml)
1. :octocat: After publishing the new release, a workflow will continue to create and commit the release build. And then update the references of the corresponding major and minor version tags onto the new release.
1. :octocat: After publishing the new release, a workflow will continue to create and commit the release build, update the references of the corresponding major and minor version tags onto the new release, and merge the release PR.
- Workflow [GitHub Actions - Release](https://github.com/woocommerce/grow/actions/workflows/github-actions-release.yml)
- When the new release version is `actions-v2.4.8`, it should update the references of `actions-v2` and `actions-v2.4` onto `actions-v2.4.8`.
- When the new release version is `actions-v2.5.0`, it should update the reference of `actions-v2` and create `actions-v2.5` tag onto `actions-v2.5.0`.
- When the new release version is `actions-v3.0.0`, it should create `actions-v3` and `actions-v3.0` tags onto `actions-v3.0.0`.
1. :technologist: Check if both release workflows are run successfully.
1. :technologist: Merge the release PR.
1. :technologist: Check if the release workflow has run successfully.

### Testing the release process

Expand Down
1 change: 1 addition & 0 deletions packages/github-actions/build-php-actions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

# Loop through all directories, building the package for each one if it has composer.json.
for d in $(find ./actions -mindepth 1 -maxdepth 1 -type d) ; do
Expand Down
Loading