2022-12-01 08:36:26 +00:00
name: 'Release : Code freeze'
2022-02-09 19:43:05 +00:00
on :
2022-12-01 08:36:26 +00:00
schedule :
2022-12-20 16:51:41 +00:00
- cron : '0 23 * * 1' # Run at 2300 UTC on Mondays.
2022-12-01 08:36:26 +00:00
workflow_dispatch :
inputs :
timeOverride :
description : "Time Override: The time to use in checking whether the action should run (default: 'now')."
default : 'now'
skipSlackPing :
description: 'Skip Slack Ping : If true, the Slack ping will be skipped (useful for testing)'
type : boolean
slackChannelOverride :
description: 'Slack Channel Override : The channel ID to send the Slack ping about the freeze'
2022-06-16 19:44:07 +00:00
env :
2023-04-19 19:07:54 +00:00
TIME_OVERRIDE : ${{ inputs.timeOverride || 'now' }}
2022-10-13 18:23:03 +00:00
GIT_COMMITTER_NAME : 'WooCommerce Bot'
GIT_COMMITTER_EMAIL : 'no-reply@woocommerce.com'
GIT_AUTHOR_NAME : 'WooCommerce Bot'
GIT_AUTHOR_EMAIL : 'no-reply@woocommerce.com'
2022-02-09 19:43:05 +00:00
2023-01-02 17:28:11 +00:00
permissions : {}
2022-02-09 19:43:05 +00:00
jobs :
2023-04-26 21:02:32 +00:00
code-freeze-prep :
name : 'Verify that today is the day of the code freeze and prepare repository'
2022-12-01 08:36:26 +00:00
runs-on : ubuntu-20.04
2023-04-26 21:02:32 +00:00
permissions :
contents : write
issues : write
2023-05-03 21:12:20 +00:00
pull-requests : write
2022-12-01 08:36:26 +00:00
outputs :
freeze : ${{ steps.check-freeze.outputs.freeze }}
2023-04-26 21:02:32 +00:00
nextReleaseBranch : ${{ steps.branch.outputs.nextReleaseBranch }}
nextReleaseVersion : ${{ steps.milestone.outputs.nextReleaseVersion }}
nextDevelopmentVersion : ${{ steps.milestone.outputs.nextDevelopmentVersion }}
2022-12-01 08:36:26 +00:00
steps :
2023-04-12 21:28:53 +00:00
- name : Checkout code
uses : actions/checkout@v3
2022-12-01 08:36:26 +00:00
with :
2023-04-12 21:28:53 +00:00
fetch-depth : 0
2022-12-01 08:36:26 +00:00
2023-05-22 21:15:46 +00:00
- name : Setup PNPM
uses : pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with :
version : '8.3.1'
- name : Setup Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with :
node-version-file : .nvmrc
cache : pnpm
registry-url : 'https://registry.npmjs.org'
2023-04-12 21:28:53 +00:00
- name : Install prerequisites
2022-12-01 08:36:26 +00:00
run : |
2023-05-22 21:15:46 +00:00
pnpm install --filter monorepo-utils --ignore-scripts
# ignore scripts speeds up setup signficantly, but we still need to build monorepo utils
pnpm build
working-directory : tools/monorepo-utils
2022-12-01 08:36:26 +00:00
2023-04-12 21:28:53 +00:00
- name : 'Check whether today is the code freeze day'
id : check-freeze
2023-04-28 00:31:33 +00:00
run : pnpm utils code-freeze verify-day -o $TIME_OVERRIDE
2022-12-01 08:36:26 +00:00
2023-04-26 21:02:32 +00:00
- name : Create next milestone
id : milestone
if : steps.check-freeze.outputs.freeze == 'true'
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2023-04-28 00:31:33 +00:00
run : pnpm run utils code-freeze milestone -o ${{ github.repository_owner }}
2022-12-01 08:36:26 +00:00
2023-04-26 21:02:32 +00:00
- name : Create next release branch
id : branch
if : steps.check-freeze.outputs.freeze == 'true'
2022-12-01 08:36:26 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2023-04-28 00:31:33 +00:00
run : pnpm run utils code-freeze branch -o ${{ github.repository_owner }}
2022-12-01 08:36:26 +00:00
2023-05-03 21:12:20 +00:00
- name : Prepare trunk for next development cycle
id : prep-trunk
if : steps.check-freeze.outputs.freeze == 'true'
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
run : pnpm run utils code-freeze version-bump -o ${{ github.repository_owner }} -v ${{ steps.milestone.outputs.nextDevelopmentVersion }}.0-dev
2022-12-01 08:36:26 +00:00
2023-05-17 22:41:46 +00:00
- name : Generate changelog changes
id : changelog
if : steps.check-freeze.outputs.freeze == 'true'
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
run : pnpm run utils code-freeze changelog -o ${{ github.repository_owner }} -v ${{ steps.milestone.outputs.nextReleaseVersion }}
2022-12-01 08:36:26 +00:00
notify-slack :
name : 'Sends code freeze notification to Slack'
runs-on : ubuntu-20.04
2023-05-03 21:12:20 +00:00
needs : code-freeze-prep
2023-05-10 21:52:56 +00:00
if : ${{ needs.code-freeze-prep.outputs.freeze == 'true' && inputs.skipSlackPing != true }}
2022-12-01 08:36:26 +00:00
steps :
2023-05-22 21:15:46 +00:00
- name : Checkout code
uses : actions/checkout@v3
2022-12-01 08:36:26 +00:00
with :
2023-05-22 21:15:46 +00:00
fetch-depth : 0
2022-12-01 08:36:26 +00:00
2023-05-22 21:15:46 +00:00
- name : Setup PNPM
uses : pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with :
version : '8.3.1'
- name : Setup Node
uses : actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with :
node-version-file : .nvmrc
cache : pnpm
registry-url : 'https://registry.npmjs.org'
- name : Install prerequisites
run : |
pnpm install --filter monorepo-utils --ignore-scripts
# ignore scripts speeds up setup signficantly, but we still need to build monorepo utils
pnpm build
working-directory : tools/monorepo-utils
- name : Slack
id : notify
run : |
pnpm utils slack "${{ secrets.CODE_FREEZE_BOT_TOKEN }}" "
:warning-8c : ${{ needs.code-freeze-prep.outputs.nextReleaseVersion }} Code Freeze :ice_cube:
2023-05-23 21:57:57 +00:00
The automation to cut the release branch for ${{ needs.code-freeze-prep.outputs.nextReleaseVersion }} has run. Any PRs that were not already merged will be a part of ${{ needs.code-freeze-prep.outputs.nextDevelopmentVersion }} by default. If you have something that needs to make ${{ needs.code-freeze-prep.outputs.nextReleaseVersion }} that hasn't yet been merged, please see the <${{ secrets.FG_LINK }}/code-freeze-for-woocommerce-core-release/|fieldguide page for the code freeze>.
2023-05-22 21:15:46 +00:00
" " ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}"