Move to main and skip develop

Using main and develop imposes a complicated release process with Gitflow etc. To simplify our release process we move our development to the main branch skipping develop.
This commit is contained in:
Nanne Baars 2023-01-14 18:24:35 +01:00
parent a0173fd8f8
commit dc0fc09679
5 changed files with 68 additions and 87 deletions

View File

@ -8,8 +8,6 @@ on:
push: push:
branches: branches:
- main - main
- develop
- release/*
tags-ignore: tags-ignore:
- '*' - '*'
paths-ignore: paths-ignore:

View File

@ -13,10 +13,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: "Get tag name"
id: tag
uses: dawidd6/action-get-tag@v1
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
@ -33,8 +29,8 @@ jobs:
- name: "Set labels for ${{ github.ref }}" - name: "Set labels for ${{ github.ref }}"
run: | run: |
echo "WEBGOAT_TAG_VERSION=${{ steps.tag.outputs.tag }}" >> $GITHUB_ENV echo "WEBGOAT_TAG_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
WEBGOAT_MAVEN_VERSION=${{ steps.tag.outputs.tag }} WEBGOAT_MAVEN_VERSION=${{ github.ref_name }}
echo "WEBGOAT_MAVEN_VERSION=${WEBGOAT_MAVEN_VERSION:1}" >> $GITHUB_ENV echo "WEBGOAT_MAVEN_VERSION=${WEBGOAT_MAVEN_VERSION:1}" >> $GITHUB_ENV
- name: Build with Maven - name: Build with Maven
run: | run: |
@ -105,19 +101,14 @@ jobs:
- name: "Image digest" - name: "Image digest"
run: echo ${{ steps.docker_build.outputs.digest }} run: echo ${{ steps.docker_build.outputs.digest }}
new_version: new_version:
permissions:
contents: write # for Git to git push
if: github.repository == 'WebGoat/WebGoat' if: github.repository == 'WebGoat/WebGoat'
name: Update development version name: Update to next SNAPSHOT version
needs: [ release ] needs: [ release ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: release
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
ref: develop fetch-depth: 0
token: ${{ secrets.WEBGOAT_DEPLOYER_TOKEN }}
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
@ -129,10 +120,18 @@ jobs:
run: | run: |
mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- name: Commit pom.xml - name: Push the changes to new branch
run: | uses: devops-infra/action-commit-push@v0.9.2
git config user.name webgoat-github with:
git config user.email owasp.webgoat@gmail.com github_token: "${{ secrets.GITHUB_TOKEN }}"
find . -name 'pom.xml' | xargs git add add_timestamp: true
git commit -m "Updating to the new development version" commit_message: "Updating to the new development version"
git push force: false
- name: Create PR
uses: devops-infra/action-pull-request@v0.5.3
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
title: ${{ github.event.commits[0].message }}
target_branch: main

View File

@ -2,14 +2,11 @@ name: "UI-Test"
on: on:
pull_request: pull_request:
paths-ignore: paths-ignore:
- '.txt'
- '*.MD'
- '*.md'
- 'LICENSE' - 'LICENSE'
- 'docs/**' - 'docs/**'
push: push:
# tags-ignore: tags-ignore:
# - '*' - 'v*'
paths-ignore: paths-ignore:
- '.txt' - '.txt'
- '*.MD' - '*.MD'

View File

@ -86,7 +86,7 @@ For example: `Fix #545` or `Closes #10`
```bash ```bash
$ git fetch upstream $ git fetch upstream
$ git merge upstream/develop $ git merge upstream/main
``` ```
See also the following article for further explanation on "[How to Keep a Downstream git Repository Current with Upstream Repository Changes](https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97 "How to Keep a Downstream git Repository Current with Upstream Repository Changes")". See also the following article for further explanation on "[How to Keep a Downstream git Repository Current with Upstream Repository Changes](https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97 "How to Keep a Downstream git Repository Current with Upstream Repository Changes")".

View File

@ -2,31 +2,18 @@
### Version numbers ### Version numbers
For WebGoat we use milestone releases first before we release the official version, we use `v8.0.0.M3` while tagging For WebGoat we use milestone releases first before we release the official version, we use `v2023.01` while tagging
and 8.0.0.M3 in the `pom.xml`. When we create the final release we remove the milestone release and use and 2023.01 in the `pom.xml`.
`v8.0.0` in the `pom.xml`
### Release notes: ### Release notes:
Update the release notes with the correct version. Use `git shortlog -s -n --since "SEP 31 2019"` for the list of Update the release notes with the correct version. Use `git shortlog -s -n --since "JAN 06 2023"` for the list of
committers. committers.
At the moment we use Gitflow, for a release you create a new release branch and take the following steps:
``` ```
git checkout develop mvn versions:set
git flow release start <version> << update release notes >>
git flow release publish git commit ....
git tag v2023.01
<<Make changes if necessary>>
<<Update RELEASE_NOTES.md>>
git flow release finish <version>
git push origin develop
git push origin main
git push --tags git push --tags
``` ```
Now Travis takes over and will create the release in Github and on Docker Hub.
NOTE: the `mvn versions:set` command above is just there to make sure the master branch contains the latest version