diff --git a/.github/release-notes.yml b/.github/release-notes.yml deleted file mode 100644 index e7dcb513a..000000000 --- a/.github/release-notes.yml +++ /dev/null @@ -1,17 +0,0 @@ -releasenotes: - sections: - - title: "Headliners" - emoji: ":star:" - labels: [ "headliner" ] - - title: "New Features" - emoji: ":sparkles:" - labels: [ "enhancement" ] - - title: "Bugs Fixed" - emoji: ":beetle:" - labels: [ "bug" ] - - title: "Documentation" - emoji: ":book:" - labels: "documentation" - - title: "Automation" - emoji: ":robot:" - labels: [ "automation" ] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..d30df62ae --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,23 @@ +changelog: + categories: + - title: Headliners + labels: + - headliner + - title: New Features + labels: + - feature + - title: Enhancements + labels: + - enhancement + - title: Bugs Fixed + labels: + - bug + - title: Documentation + labels: + - documentation + - title: Automation + labels: + - automation + - title: Other changes + labels: + - "*" diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 036ce698d..be0d78f4e 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -14,18 +14,18 @@ jobs: env: MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '11' - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.m2/repository @@ -43,4 +43,4 @@ jobs: run: mvn -B -q spotless:check - name: Upload Coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 diff --git a/.github/workflows/create-hotfix-branch.yaml b/.github/workflows/create-hotfix-branch.yaml index 8eb462859..ead9da2d6 100644 --- a/.github/workflows/create-hotfix-branch.yaml +++ b/.github/workflows/create-hotfix-branch.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout master - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: master token: ${{ secrets.ADMIN_GITHUB_TOKEN }} @@ -29,44 +29,27 @@ jobs: - name: Get latest tag if: ${{ !github.event.inputs.version }} - uses: actions-ecosystem/action-get-latest-tag@v1 + run: echo "LATEST_TAG= $(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV id: get-latest-tag - name: Format latest tag if: ${{ !github.event.inputs.version }} - run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^koryphe-//')" >> $GITHUB_ENV + run: echo "CURRENT_VERSION=$(echo ${{ env.LATEST_TAG }} | sed 's/^koryphe-//')" >> $GITHUB_ENV - - name: Bump latest tag variable + - name: Bump latest tag variable version if: ${{ !github.event.inputs.version }} - uses: actions-ecosystem/action-bump-semver@v1 - id: bump-semver - with: - current_version: ${{ env.CURRENT_VERSION }} - level: patch - - - name: Set version automatically - if: ${{ !github.event.inputs.version }} - run: echo "RELEASE_VERSION=$(echo ${{ steps.bump-semver.outputs.new_version }} )" >> $GITHUB_ENV + run: echo "RELEASE_VERSION=$(echo ${{ env.CURRENT_VERSION }} | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/echo \1.\2.$((\3+1))/' | sh)" >> $GITHUB_ENV - name: Verify version regex - uses: actions-ecosystem/action-regex-match@v2 - id: regex-match - with: - text: ${{ env.RELEASE_VERSION }} - # Ensure version doesn't end in .0 - regex: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.([1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - - - name: Fail if incorrect version - if: ${{ !steps.regex-match.outputs.match }} - run: exit 1 + run: echo ${{ env.RELEASE_VERSION }} | grep -E '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - name: Set hotfix branch run: echo "BRANCH_NAME=$(echo hotfix/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV - name: Set up Github credentials run: | - git config user.name Gaffer - git config user.email github-actions@github.com + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com - name: Update versions run: | diff --git a/.github/workflows/create-release-branch.yaml b/.github/workflows/create-release-branch.yaml index 526e4b1e7..f9133ffc1 100644 --- a/.github/workflows/create-release-branch.yaml +++ b/.github/workflows/create-release-branch.yaml @@ -1,11 +1,9 @@ name: Create Release Branch on: - workflow_dispatch: - inputs: - version: - description: 'Release Branch Version' - required: false + milestone: + types: + - closed env: artifactId: koryphe @@ -17,56 +15,22 @@ jobs: steps: - name: Checkout develop - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: develop token: ${{ secrets.ADMIN_GITHUB_TOKEN }} fetch-depth: 0 - - name: Set version from input - if: ${{ github.event.inputs.version }} - run: echo "RELEASE_VERSION=$(echo ${{ github.event.inputs.version }} | sed 's/^v//')" >> $GITHUB_ENV - - - name: Get latest tag - if: ${{ !github.event.inputs.version }} - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - - - name: Format latest tag - if: ${{ !github.event.inputs.version }} - run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^koryphe-//')" >> $GITHUB_ENV - - - name: Bump latest tag variable - if: ${{ !github.event.inputs.version }} - uses: actions-ecosystem/action-bump-semver@v1 - id: bump-semver - with: - current_version: ${{ env.CURRENT_VERSION }} - level: minor - - - name: Set version automatically - if: ${{ !github.event.inputs.version }} - run: echo "RELEASE_VERSION=$(echo ${{ steps.bump-semver.outputs.new_version }} )" >> $GITHUB_ENV - - - name: Verify version regex - uses: actions-ecosystem/action-regex-match@v2 - id: regex-match - with: - text: ${{ env.RELEASE_VERSION }} - # Ensure valid semver version - regex: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' - - - name: Fail if incorrect version - if: ${{ !steps.regex-match.outputs.match }} - run: exit 1 + - name: Set version from milestone + run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }})" >> $GITHUB_ENV - name: Set release branch run: echo "BRANCH_NAME=$(echo release/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV - name: Set up Github credentials run: | - git config user.name Gaffer - git config user.email github-actions@github.com + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com - name: Update versions run: | @@ -77,3 +41,14 @@ jobs: git checkout -b $BRANCH_NAME git commit -a -m "prepare release $artifactId-$RELEASE_VERSION" git push --set-upstream origin $BRANCH_NAME + + - name: Tag release branch + run: | + git tag koryphe-$RELEASE_VERSION + git push origin --tags + + - name: Create PR to master + run: | + gh pr create -B master -H $BRANCH_NAME --title 'Merge release into master branch' --body 'Created by GH Action' + env: + GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} diff --git a/.github/workflows/link-issue.yml b/.github/workflows/link-issue.yml index 8e87000d6..ae3c5d9e6 100644 --- a/.github/workflows/link-issue.yml +++ b/.github/workflows/link-issue.yml @@ -7,7 +7,7 @@ jobs: issue-links: runs-on: ubuntu-latest steps: - - uses: tkt-actions/add-issue-links@v1.6.0 + - uses: tkt-actions/add-issue-links@v1.8.2 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' branch-prefix: 'gh-' diff --git a/.github/workflows/release-standalone.yaml b/.github/workflows/release-standalone.yaml index b295f0034..54e41f137 100644 --- a/.github/workflows/release-standalone.yaml +++ b/.github/workflows/release-standalone.yaml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '8' - name: Checkout master - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: master diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cafbc9504..cb9e7c9ab 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,31 +1,32 @@ name: Release on: - milestone: - types: - - closed + pull_request: + branches: + - master + types: [closed] env: artifactId: koryphe MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 - jobs: - create-release-tag: + deploy-release: + if: ${{ github.event.pull_request.merged }} runs-on: ubuntu-latest outputs: - branch_name: ${{ steps.branch.outputs.branch_name }} + release_version: ${{ steps.release-version.outputs.release_version }} steps: - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '11' - name: Checkout master - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: master token: ${{ secrets.ADMIN_GITHUB_TOKEN }} @@ -33,132 +34,39 @@ jobs: - name: Set up Github credentials run: | - git config user.name Gaffer - git config user.email github-actions@github.com - - - name: Set release version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV - - - name: Set branch name - run: echo "BRANCH_NAME=$(git branch -a | grep $RELEASE_VERSION | tail -n 1 | cut -c 18-)" >> $GITHUB_ENV - - - name: Output branch name - id: branch - run: echo "::set-output name=branch_name::$BRANCH_NAME" - - - name: Fail if no branch found - if: ${{ !env.BRANCH_NAME }} - run: exit 1 - - - name: Checkout master - uses: actions/checkout@v2 - with: - ref: master - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Merge release into master - run: | - git checkout ${{ env.BRANCH_NAME }} - git checkout master - git merge ${{ env.BRANCH_NAME }} + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - name: Push changes + - name: Output release version + id: release-version run: | - git tag $artifactId-$RELEASE_VERSION - git push origin $artifactId-$RELEASE_VERSION - git push - - update-develop: - runs-on: ubuntu-latest - needs: - - create-release-tag - - steps: - - name: Checkout develop - uses: actions/checkout@v2 - with: - ref: develop - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Set up Github credentials - run: | - git config user.name Gaffer - git config user.email github-actions@github.com - - - name: Setup JDK - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '11' - - - name: Merge release into develop - run: | - git checkout ${{ needs.create-release-tag.outputs.branch_name }} - git checkout develop - git merge ${{ needs.create-release-tag.outputs.branch_name }} --strategy-option theirs - - - name: Update development branch - run: | - git checkout develop - mvn release:update-versions -B - git commit -a -m "prepare for next development iteration" - git push - - update-github-releases: - runs-on: ubuntu-latest - needs: - - create-release-tag - - steps: - - name: Checkout Master - uses: actions/checkout@v2 - with: - ref: master - - - name: Create Release Notes - uses: docker://decathlon/release-notes-generator-action:2.1.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV - - - name: Upload notes - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }} - name: Koryphe ${{ env.RELEASE_VERSION }} - body_path: release_file.md + echo "release_version=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)" >> $GITHUB_OUTPUT generate-javadoc: runs-on: ubuntu-latest needs: - - create-release-tag + - deploy-release steps: - - name: Checkout Master - uses: actions/checkout@v2 + - name: Checkout master + uses: actions/checkout@v4 with: ref: master token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - name: Set up Github credentials run: | - git config user.name Gaffer - git config user.email github-actions@github.com + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '11' - name: Set version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV + run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV - name: Upload Javadoc run: | @@ -177,17 +85,17 @@ jobs: release-to-nexus: runs-on: ubuntu-latest needs: - - create-release-tag + - deploy-release steps: - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '11' - name: Checkout master - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: master @@ -208,19 +116,59 @@ jobs: OSS_NEXUS_PASSWORD: ${{ secrets.OSS_NEXUS_PASSWORD }} run: mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B - trigger-update-gaffer-koryphe-version: + update-github-releases: runs-on: ubuntu-latest needs: - - create-release-tag - + - deploy-release + steps: + - name: Checkout Master + uses: actions/checkout@v4 + with: + ref: master + - name: Set version - run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV + run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV + + - name: Create release notes + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }} + name: Koryphe ${{ env.RELEASE_VERSION }} - - name: Update Gaffer Koryphe version - uses: benc-uk/workflow-dispatch@v1 + update-develop: + runs-on: ubuntu-latest + needs: + - deploy-release + + steps: + - name: Checkout develop + uses: actions/checkout@v4 with: - workflow: Update Korpyhe Version - repo: gchq/Gaffer + ref: develop token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - inputs: '{ "version": "${{ env.RELEASE_VERSION }}" }' + fetch-depth: 0 + + - name: Set up Github credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Setup JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '11' + + - name: Merge master into develop + run: | + git merge origin/master + + - name: Update develop branch + run: | + git checkout develop + mvn release:update-versions -B + git commit -a -m "prepare for next development iteration" + git push diff --git a/cd/after_success.sh b/cd/after_success.sh deleted file mode 100755 index deb86ec81..000000000 --- a/cd/after_success.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then - bash <(curl -s https://codecov.io/bash) -fi diff --git a/core/pom.xml b/core/pom.xml index 29fad2ffa..de9bb1ca4 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,6 +1,6 @@