-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FSR-1192 | Add defensive and cleanup measures to release creation GitHub action (#683) * Add defensive measures * don't push changes until after version bump and release note creation * delete release branch if it exists and any step fails * Refine the release notes to reflect findings from recent release creation * Rename script for clarity * FSR-0000 | allow git to decide merge strategy (#685) * fix for release date validation for release git hub action (#696) * release date validation temporary removal * Bump version number (8.3.0) * Add release notes (8.3.0) * Update CFF-8.3.0.md updated notes to include TA update ticket --------- Co-authored-by: Neil McLaughlin <[email protected]> Co-authored-by: GitHub Actions <[email protected]>
- Loading branch information
1 parent
8b128bb
commit 6aa2b0e
Showing
7 changed files
with
101 additions
and
20 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 |
---|---|---|
|
@@ -34,9 +34,6 @@ jobs: | |
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Setup version env vars | ||
run: | | ||
version=${{ github.event.inputs.version }} | ||
|
@@ -52,14 +49,36 @@ jobs: | |
exit 1 | ||
fi | ||
- name: Check PR's approved | ||
run: | | ||
function prCheck () { | ||
REPO=$1 | ||
BASE=$2 | ||
STATE=$(gh pr list --repo $GITHUB_REPOSITORY_OWNER/$REPO --json title,mergeStateStatus,state,reviews --state OPEN --base $BASE --head $RELEASE_BRANCH --jq '.[] | select(.mergeStateStatus == "CLEAN" and .reviews[].state == "APPROVED") | .reviews[].state ') | ||
if [ "$STATE" != "APPROVED" ]; then | ||
echo "Error: PR for merging $GITHUB_REPOSITORY_OWNER/$REPO $RELEASE_BRANCH into $BASE needs to be ready to merge and approved. (STATE=$STATE)" >&2 | ||
exit 1 | ||
fi | ||
} | ||
prCheck flood-app master | ||
prCheck flood-app development | ||
prCheck flood-service master | ||
prCheck flood-service development | ||
env: | ||
# create classic PAT and then run `gh secret set GH_WORKFLOW` | ||
GH_TOKEN: ${{ secrets.GH_WORKFLOW }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Merge release branch into master | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git switch $RELEASE_BRANCH | ||
git switch master | ||
git merge --ff-only $RELEASE_BRANCH | ||
git push | ||
git merge --no-edit $RELEASE_BRANCH | ||
git push origin master | ||
- name: Create GitHub Release | ||
run: gh release create $TAG_VERSION --title "Release $VERSION" --notes "[release notes](/$RELEASE_NOTES_FILE)" | ||
|
@@ -70,8 +89,8 @@ jobs: | |
- name: Merge release branch into development | ||
run: | | ||
git switch development | ||
git merge --ff-only $RELEASE_BRANCH | ||
git push | ||
git merge --no-edit $RELEASE_BRANCH | ||
git push origin development | ||
- name: Trigger Merge Release Branch for flood-service | ||
run: gh workflow run --repo "$GITHUB_REPOSITORY_OWNER/flood-service" merge.yml -f version="$VERSION" | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Check For Flooding Release | ||
|
||
* Version: 8.3.0 | ||
* Proposed Release Date: 22/05/2024 | ||
* Jira Release Overview: https://eaflood.atlassian.net/projects/FSR/versions/16850/tab/release-report-all-issues | ||
|
||
## Tickets | ||
|
||
* FSR-1193 | TA Update - 22 May 2024 | ||
|
||
## Instructions | ||
|
||
This release is for target area updates | ||
|
||
1 - Update LFW_{STAGE}_99_LOAD_FLOOD_ALERT_AREAS jenkins job with the following properties update for the updated database name for production: | ||
|
||
DB_NAME=floodprdg | ||
###### OR ######## | ||
DB_NAME=floodprdb | ||
|
||
2 - Execute LFW_{STAGE}_99_LOAD_FLOOD_ALERT_AREAS | ||
|
||
3 - Execute LFW_{STAGE}_04_UPDATE_FLOOD_APP_AND_SERVICE_PIPELINE | ||
|
||
|
||
Execute smoke tests and forward results | ||
|
||
## Related Infrastructure Changes Required | ||
|
||
* None |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict' | ||
|
||
const Lab = require('@hapi/lab') | ||
const { expect } = require('@hapi/code') | ||
const { describe, it } = exports.lab = Lab.script() | ||
|
||
async function executeNpmScript (scriptName) { | ||
const util = require('util') | ||
const exec = util.promisify(require('child_process').exec) | ||
try { | ||
const { stdout, stderr } = await exec(`npm run ${scriptName}`) | ||
return { stdout, stderr } | ||
} catch (error) { | ||
return { stdout: '', stderr: error.stderr } | ||
} | ||
} | ||
describe('scripts', () => { | ||
it('should run help for create-release-notes successfully', async () => { | ||
// this test is to check that all the necessary modules are installed following the accidental | ||
// removal of nunjucks and yargs which wasn't picked up until the create release github action | ||
// was run | ||
const { stdout, stderr } = await executeNpmScript('create-release-notes -- --help') | ||
|
||
expect(stderr).to.be.empty() | ||
expect(stdout).to.contain('node release-docs/lib/create-release-notes.js --help') | ||
}) | ||
}) |