-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@W-17312010@ Preparing dev-5 to replace dev as v5 home branch
- Loading branch information
1 parent
d06b633
commit 9c593e7
Showing
9 changed files
with
120 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: automated-release-tasks | ||
on: | ||
schedule: | ||
# Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value,' and multiple values | ||
# can be specified with comma-separated lists. All times are UTC. | ||
# So this expression means "run at 12 PM UTC, every Friday". | ||
- cron: "0 12 * * 5" | ||
|
||
|
||
jobs: | ||
# Depending on circumstances, we may want to exit early instead of running the workflow to completion. | ||
verify-should-run: | ||
runs-on: macos-latest | ||
outputs: | ||
should-run: ${{ steps.main.outputs.should_run }} | ||
steps: | ||
- id: main | ||
run: | | ||
# `date -u` returns UTC datetime, and `%u` formats the output to be the day of the week, with 1 being Monday, | ||
# 2 being Tuesday, etc. | ||
TODAY_DOW=$(date -u +%u) | ||
# This `date` expression returns the last Tuesday of the month, which is our Release Day. %d formats the output | ||
# as the day of the month (1-31). | ||
NEXT_RELEASE_DATE=$(date -u -v1d -v+1m -v-1d -v-tue +%d) | ||
# This `date` expression returns next Tuesday, and `%d` formats the output as the day of the month (1-31). | ||
NEXT_TUESDAY_DATE=$(date -u -v+tue +%d) | ||
# This workflow should only be allowed to run to completion on the Friday before Release Day. | ||
[[ $TODAY_DOW != 5 || $NEXT_RELEASE_DATE != $NEXT_TUESDAY_DATE ]] && echo "should_run=false" >> "$GITHUB_OUTPUT" || echo "should_run=true" >> "$GITHUB_OUTPUT" | ||
create-v5-release-branch: | ||
runs-on: macos-latest | ||
needs: verify-should-run | ||
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }} | ||
steps: | ||
- name: Invoke v5 beta workflow | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} | ||
script: | | ||
await github.rest.actions.createWorkflowDispatch({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: 'create-release-branch.yml', | ||
ref: 'dev' | ||
}); | ||
create-v4-release-branch: | ||
runs-on: macos-latest | ||
needs: verify-should-run | ||
if: ${{ needs.verify-should-run.outputs.should-run == 'true' }} | ||
steps: | ||
- name: Invoke v4 GA workflow | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} | ||
script: | | ||
await github.rest.actions.createWorkflowDispatch({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: 'create-release-branch.yml', | ||
ref: 'dev-4', | ||
inputs: { | ||
"release-type": "minor" | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.