2022-07-21 22:58:23 +00:00
name : "Release: Code freeze"
2022-02-09 19:43:05 +00:00
on :
schedule :
- cron : '0 16 * * 4' # Run at 1600 UTC on Thursdays.
2022-06-16 19:44:07 +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"
env :
TIME_OVERRIDE : ${{ inputs.timeOverride }}
2022-02-09 19:43:05 +00:00
jobs :
maybe-create-next-milestone-and-release-branch :
name : "Maybe create next milestone and release branch"
2022-04-27 01:28:56 +00:00
runs-on : ubuntu-20.04
2022-06-16 19:44:07 +00:00
outputs :
branch : ${{ steps.freeze.outputs.branch }}
release_version : ${{ steps.freeze.outputs.release_version }}
next_version : ${{ steps.freeze.outputs.next_version }}
2022-02-09 19:43:05 +00:00
steps :
2022-06-16 19:44:07 +00:00
- name : Checkout code
uses : actions/checkout@v3
with :
fetch-depth : 100
- uses : ./.github/actions/cache-deps
with :
workflow_name : release-code-freeze
workflow_cache : ${{ secrets.WORKFLOW_CACHE }}
- name : Install PNPM
run : npm install -g pnpm@^6.24.2
2022-02-09 19:43:05 +00:00
- name : "Install PHP"
uses : shivammathur/setup-php@v2
with :
php-version : '7.4'
2022-06-16 19:44:07 +00:00
tools : composer
- name : Install dependencies
run : pnpm install
2022-02-09 19:43:05 +00:00
- name : "Run the script to enforce the code freeze"
2022-06-16 19:44:07 +00:00
id : freeze
run : php .github/workflows/scripts/release-code-freeze.php
2022-02-09 19:43:05 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-06-16 19:44:07 +00:00
GITHUB_OUTPUTS : 1
2022-05-27 16:44:43 +00:00
2022-06-16 19:44:07 +00:00
notify-slack :
name : "Sends code freeze notification to Slack"
if : ${{ inputs.skipSlackPing != true }}
runs-on : ubuntu-20.04
needs : maybe-create-next-milestone-and-release-branch
steps :
2022-05-27 16:44:43 +00:00
- name : Slack
uses : archive/github-actions-slack@v2.0.0
id : notify
with :
2022-06-16 19:44:07 +00:00
slack-bot-user-oauth-access-token : ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
slack-channel : ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
slack-text : |
:warning-8c : ${{ needs.maybe-create-next-milestone-and-release-branch.outputs.release_version }} Code Freeze :ice_cube:
The automation to cut the release branch for ${{ needs.maybe-create-next-milestone-and-release-branch.outputs.release_version }} has run. Any PRs that were not already merged will be a part of ${{ needs.maybe-create-next-milestone-and-release-branch.outputs.next_version }} by default. If you have something that needs to make ${{ needs.maybe-create-next-milestone-and-release-branch.outputs.release_version }} that hasn't yet been merged, please see the <${{ secrets.FG_LINK }}/code-freeze-for-woocommerce-core-release/|fieldguide page for the code freeze>.
2022-07-21 22:58:23 +00:00
trigger-changelog-action :
name : "Trigger changelog action"
runs-on : ubuntu-20.04
needs : maybe-create-next-milestone-and-release-branch
steps :
- run : |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.WC_BOT_TRIAGE_TOKEN }}" \
-d '{"ref":"refs/heads/trunk","inputs":{"releaseBranch":"${{ needs.maybe-create-next-milestone-and-release-branch.outputs.branch }}","releaseVersion":"${{ needs.maybe-create-next-milestone-and-release-branch.outputs.release_version }}"}}' \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/release-changelog.yml/dispatches