From b76c5fe7c944e13bc4e837ce11885091fbc487bd Mon Sep 17 00:00:00 2001 From: larsk21 <57503246+larsk21@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:45:45 +0100 Subject: [PATCH 1/5] switch to parent release and disable snapshot repositories --- pom.xml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index b42c5ff6..7686c167 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ tools.vitruv parent - 3.0.0-SNAPSHOT + 3.0.2 @@ -75,19 +75,6 @@ - - - ossrh-snapshots - OSSRH Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - false - - - emf-compare From 96576ff6d712255135b88ab1feb591f9e3931852 Mon Sep 17 00:00:00 2001 From: larsk21 <57503246+larsk21@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:43:47 +0100 Subject: [PATCH 2/5] add release scripts --- .github/prepare-release | 24 +++++++++++++++++++ .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 .github/prepare-release create mode 100644 .github/workflows/release.yml diff --git a/.github/prepare-release b/.github/prepare-release new file mode 100755 index 00000000..b2809391 --- /dev/null +++ b/.github/prepare-release @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ $# -lt 2 ]; +then + echo "usage: $0 " >&2 + echo "" >&2 + echo "release-version : Version of the next release, e.g., 3.1.0" >&2 + echo "new-snapshot-version: Version of the upcoming nightly releases without the -SNAPSHOT suffix, e.g., 3.2.0" >&2 + return 1 +fi + +git switch -C prepare-release/$1 || exit 1 + +set_version_and_commit() { + ./mvnw versions:set -DnewVersion=$1 -DgenerateBackupPoms=false || return 1 + + git add pom.xml || return 1 + git add "**/pom.xml" 2> /dev/null + + git commit -m "$2" || return 1 +} + +set_version_and_commit "$1" "[Release] Version $1" +set_version_and_commit "$2-SNAPSHOT" "[Release] Update version to $2-SNAPSHOT" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..5a2ba706 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +# workflow triggers +on: + # manually + workflow_dispatch: + # releases + release: + types: [published] + +jobs: + release: + name: Release + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.1 + + - name: Setup Java and Maven cache + uses: actions/setup-java@v3.13.0 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Deploy to staging and release + run: > + ./mvnw clean deploy -P release + --batch-mode + --update-snapshots + --no-transfer-progress + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} From 405a4a9399b01367abc2672cdae390ad6b572ca0 Mon Sep 17 00:00:00 2001 From: larsk21 <57503246+larsk21@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:28:51 +0100 Subject: [PATCH 3/5] update parent version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7686c167..d28e9a8a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ tools.vitruv parent - 3.0.2 + 3.0.4 From 500033ba186852e06b43fc6affe8ae9987fc94ca Mon Sep 17 00:00:00 2001 From: larsk21 <57503246+larsk21@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:29:48 +0100 Subject: [PATCH 4/5] add verification step to release workflow --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a2ba706..2f50a916 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,35 @@ on: types: [published] jobs: + verify: + name: Verify build + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Setup Java and Maven cache + uses: actions/setup-java@v4.5.0 + with: + distribution: 'temurin' + java-version: '17' + check-latest: true + cache: 'maven' + + - name: Verify build + run: > + ./mvnw clean verify + --batch-mode + --update-snapshots + --no-transfer-progress + release: name: Release runs-on: ubuntu-latest + needs: [verify] strategy: fail-fast: true @@ -35,6 +61,7 @@ jobs: - name: Deploy to staging and release run: > ./mvnw clean deploy -P release + -DskipTests --batch-mode --update-snapshots --no-transfer-progress From 937fe4f2fa81bb116186dd28509db51c118aac0e Mon Sep 17 00:00:00 2001 From: larsk21 <57503246+larsk21@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:03:45 +0100 Subject: [PATCH 5/5] verify release build on all OSes --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f50a916..45d5e9f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,12 @@ on: jobs: verify: - name: Verify build - runs-on: ubuntu-latest + name: Verify build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] steps: - name: Checkout repository