From 31de4c0638d50fad6b625b87512dc562b9b083a8 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Sun, 15 Oct 2023 13:43:39 +0200 Subject: [PATCH] chore(actions): handle 2.2 and 2.1 release branches --- .github/dependabot.yml | 20 ++++++++++++++++++++ .github/workflows/release.yaml | 13 ++++++++++--- .github/workflows/update-npm-deps.yaml | 4 +++- .github/workflows/validation.yaml | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9b441268..03616a02 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,26 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "maven" + directory: "/" + target-branch: "2.2" + schedule: + interval: "daily" + ignore: + - dependency-name: "dev.hilla:*" + update-types: [ "version-update:semver-major", "version-update:semver-minor"] + - dependency-name: "com.vaadin:*" + update-types: [ "version-update:semver-major", "version-update:semver-minor"] + - package-ecosystem: "maven" + directory: "/" + target-branch: "2.1" + schedule: + interval: "daily" + ignore: + - dependency-name: "dev.hilla:*" + update-types: [ "version-update:semver-major", "version-update:semver-minor"] + - dependency-name: "com.vaadin:*" + update-types: [ "version-update:semver-major", "version-update:semver-minor"] - package-ecosystem: "maven" directory: "/" target-branch: "1.0" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c31e8631..69b3c0c7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,9 @@ on: type: choice default: 'main' options: - - main + - "main" + - "2.2" + - "2.1" - "1.0" version: description: "Version to release (e.g. 1.1.0 or 1.2.0-alpha1)" @@ -59,12 +61,17 @@ jobs: | tee -a $GITHUB_STEP_SUMMARY exit 1 fi + if [[ "${{ inputs.target-branch }}" != "main" && ! "${{ inputs.version }}" = "${{ inputs.target-branch }}."* ]]; then + echo "ERROR: Invalid version specified: '${{ inputs.version }}' does not match the release branch '${{ inputs.target-branch }}'." \ + | tee -a $GITHUB_STEP_SUMMARY + exit 1 + fi if git rev-parse -q --verify "refs/tags/${{ inputs.version }}" > /dev/null; then - echo "🚫 Version ${{ inputs.version }} already exists. Please choose a different version." \ + echo "🚫 Version '${{ inputs.version }}' already exists. Please choose a different version." \ | tee -a $GITHUB_STEP_SUMMARY exit 1 fi - + echo "Releasing version '${{ inputs.version }}' from branch '${{ inputs.target-branch }}'." >> $GITHUB_STEP_SUMMARY - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/update-npm-deps.yaml b/.github/workflows/update-npm-deps.yaml index 94c46f87..00484c78 100644 --- a/.github/workflows/update-npm-deps.yaml +++ b/.github/workflows/update-npm-deps.yaml @@ -9,6 +9,8 @@ on: default: 'main' options: - "main" + - "2.2" + - "2.1" - "1.0" schedule: - cron: '0 2 * * *' @@ -25,7 +27,7 @@ jobs: id: set-matrix run: | if [[ -z "${{ inputs.target-branch }}" ]]; then - echo 'matrix={ "branch": ["main","1.0"] }' >> "$GITHUB_OUTPUT" + echo 'matrix={ "branch": ["main","2.2","2.1","1.0"] }' >> "$GITHUB_OUTPUT" else echo 'matrix={ "branch": ["${{ inputs.target-branch }}"] }' >> "$GITHUB_OUTPUT" fi diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml index 2b0fe198..27eb8815 100644 --- a/.github/workflows/validation.yaml +++ b/.github/workflows/validation.yaml @@ -1,7 +1,7 @@ name: Quarkus Hilla Validation on: push: - branches: [main, '1.0'] + branches: [main, '2.2', '2.1', '2.0', '1.0'] workflow_dispatch: pull_request_target: types: [opened, synchronize, reopened, edited]