Skip to content

Commit

Permalink
Revert "Release 8.3.0 (#697)"
Browse files Browse the repository at this point in the history
This reverts commit abcbc51.
  • Loading branch information
nikiwycherley committed May 20, 2024
1 parent abcbc51 commit 8b128bb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 101 deletions.
33 changes: 7 additions & 26 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Setup version env vars
run: |
version=${{ github.event.inputs.version }}
Expand All @@ -49,36 +52,14 @@ 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 --no-edit $RELEASE_BRANCH
git push origin master
git merge --ff-only $RELEASE_BRANCH
git push
- name: Create GitHub Release
run: gh release create $TAG_VERSION --title "Release $VERSION" --notes "[release notes](/$RELEASE_NOTES_FILE)"
Expand All @@ -89,8 +70,8 @@ jobs:
- name: Merge release branch into development
run: |
git switch development
git merge --no-edit $RELEASE_BRANCH
git push origin development
git merge --ff-only $RELEASE_BRANCH
git push
- name: Trigger Merge Release Branch for flood-service
run: gh workflow run --repo "$GITHUB_REPOSITORY_OWNER/flood-service" merge.yml -f version="$VERSION"
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
- name: Display inputs
run: echo "${{ github.event.inputs.jira_release_id }} ${{ github.event.inputs.increment }} ${{ github.event.inputs.db_changes }} ${{ github.event.inputs.proposed_release_date }}"

- name: Validate date
run: |
date=$(date --date "${{ github.event.inputs.proposed_release_date }}" "+%d/%m/%Y")
echo FORMATTED_DATE=$(date --date $date "+%A %d %B %Y") >> "$GITHUB_ENV"
- name: Check PAT token is still valid
run: |
gh workflow list --repo "$GITHUB_REPOSITORY_OWNER/flood-service"
Expand Down Expand Up @@ -74,6 +79,7 @@ jobs:
git switch -c $RELEASE_BRANCH
git add .
git commit -m "Bump version number (${VERSION})"
git push origin $RELEASE_BRANCH
env:
FLOOD_APP_BING_KEY: "${{ secrets.FLOOD_APP_BING_KEY }}"
FLOOD_APP_BING_KEY_LOCATION: "${{ secrets.FLOOD_APP_BING_KEY_LOCATION }}"
Expand All @@ -98,12 +104,10 @@ jobs:
--template "release-docs/template.njk"
git add $release_notes_file
git commit --no-verify -m "Add release notes (${VERSION})"
git push origin $RELEASE_BRANCH
echo RELEASE_NOTES_FILE=$release_notes_file >> "$GITHUB_ENV"
fi
- name: Push changes
run: git push origin $RELEASE_BRANCH

- name: Create Draft PRs
run: |
gh pr create --base master --title "Release $VERSION" --body "TBC"
Expand All @@ -117,11 +121,3 @@ jobs:
env:
# use PAT token with repo scope (github.token didn't work)
GH_TOKEN: ${{ secrets.GH_WORKFLOW }}

- name: Clean up
if: ${{ failure() }}
run: |
if git ls-remote --exit-code origin "refs/heads/${RELEASE_BRANCH}"; then
echo "Action failed, removing created release branch"
git push --delete origin $RELEASE_BRANCH
fi
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flood-app",
"version": "8.3.0",
"version": "8.2.0",
"description": "Flood risk app",
"main": "index.js",
"repository": "github:defra/flood-app",
Expand Down
30 changes: 0 additions & 30 deletions release-docs/CFF-8.3.0.md

This file was deleted.

7 changes: 3 additions & 4 deletions release-docs/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

## Sense Check

* Note that this is the definitive release notes for WebOps. The release notes in flood-service and flood-db are for CFF dev team use only.
* Cross check the list of Jira tickets below with those in the Jira release linked to above and update where needed
* Add additional Jira tickets from the related release notes in the 'Release {{ version }}' PR's created in:
* [flood-service](https://github.com/DEFRA/flood-service)
* Add additional Jira tickets from the related release notes:
* [flood-service](https://github.com/DEFRA/flood-service/blob/release/{{ version }}/release-docs/CFF-{{ version }}.md)
{% if dbChanges %}
* [flood-db](https://github.com/DEFRA/flood-db)
* [flood-db](https://github.com/DEFRA/flood-db/blob/release{{ version }}/release-docs/CFF-{{ version }}.md)
{% endif %}
* Add any required infrastructure changes such as redirects to the infrastructure changes section below
* Once this sense check is done, delete this section
Expand Down
27 changes: 0 additions & 27 deletions test/scripts.js

This file was deleted.

0 comments on commit 8b128bb

Please sign in to comment.