From bb254f9713e4b0945a90e665ac3267bd1061a60c Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Mon, 16 Sep 2024 14:56:02 -0700 Subject: [PATCH 1/8] Add GitHub workflows for testing and building --- .github/workflows/ci.yaml | 22 ++++++++++++++ .github/workflows/release.yaml | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..477ff03 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: Verify + +on: + push: + branches-ignore: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Build with Maven + run: mvn --batch-mode package diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..4124e1c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,52 @@ +name: Release + +on: + push: + branches: + - master* + +jobs: + build: + runs-on: ubuntu-latest + if: ${{ github.actor != 'who-icatx-bot[bot]' }} + steps: + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.ICATX_BOT_APP_ID }} + private-key: ${{ secrets.ICATX_BOT_APP_PRIVATE_KEY }} + - uses: actions/checkout@v4 + with: + token: ${{ steps.app-token.outputs.token }} + ref: ${{ github.head_ref }} + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: docker.io + server-username: DOCKER_USERNAME + server-password: DOCKER_PASSWORD + - name: Bump version + id: bump + uses: mickem/gh-action-bump-maven-version@v1 + - name: Build package + run: mvn --batch-mode clean package + - name: Build and push image + run: mvn --batch-mode package install + - name: Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.bump.outputs.tag }} + generate_release_notes: true + +env: + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} + DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} From b60b7bf1303f1ff43684ba8b8c9d25ac684c0677 Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Mon, 16 Sep 2024 15:05:06 -0700 Subject: [PATCH 2/8] Update branches --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 477ff03..2793d6b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: Verify on: push: branches-ignore: - - master + - main jobs: build: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4124e1c..74e4be9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Release on: push: branches: - - master* + - main jobs: build: From 7ef4af2cd60d8b0bcc10ac85f3ff6f3f0f9477f7 Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Mon, 16 Sep 2024 15:05:46 -0700 Subject: [PATCH 3/8] Change branches back to master in workflows --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2793d6b..477ff03 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: Verify on: push: branches-ignore: - - main + - master jobs: build: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 74e4be9..755d196 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Release on: push: branches: - - main + - master jobs: build: From 087daa7681a0f64e0d51c515defcd92ccd8e6404 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 16 Sep 2024 22:17:28 +0000 Subject: [PATCH 4/8] ci: version bump 1.0.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1b79e18..2e8fa48 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ edu.stanford.protege webprotege-linearization-service - 1.0.2 + 1.0.3 webprotege-linearization-service This service reads linearization documents from cloud storage (using MinIO) and, from these, generates WebProtégé linearization. Also, it handles querying and event sourcing From fd8fb23f7e3896d993cc18fea7358827a6195a54 Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Mon, 16 Sep 2024 15:26:09 -0700 Subject: [PATCH 5/8] Use maven exec plugin for building and pushing docker images --- pom.xml | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 1b79e18..fafab72 100644 --- a/pom.xml +++ b/pom.xml @@ -145,24 +145,47 @@ spring-boot-maven-plugin - com.spotify - dockerfile-maven-plugin - 1.4.13 + org.codehaus.mojo + exec-maven-plugin + 3.3.0 - default + docker-build + package - build + exec + + docker + ${project.basedir} + + build + -f + Dockerfile + --build-arg + JAR_FILE=${project.artifactId}-${project.version}.jar + -t + protegeproject/${project.artifactId}:${project.version} + . + + + + + docker-push + install + + exec + + + docker + ${project.basedir} + + push + protegeproject/${project.artifactId}:${project.version} + + - - protegeproject/${project.artifactId} - ${project.version} - - ${project.build.finalName}.jar - - From c25d59cdca0dc2bb5bdcf32bd04eff0d80bac7e9 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 16 Sep 2024 22:26:48 +0000 Subject: [PATCH 6/8] ci: version bump 1.0.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72bbd00..aa88d0c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ edu.stanford.protege webprotege-linearization-service - 1.0.3 + 1.0.4 webprotege-linearization-service This service reads linearization documents from cloud storage (using MinIO) and, from these, generates WebProtégé linearization. Also, it handles querying and event sourcing From cb8f849d2698437a7a8ed55a9570cef649d2e589 Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Mon, 16 Sep 2024 16:15:42 -0700 Subject: [PATCH 7/8] Added permissions to the workflow file --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 755d196..5ceeb7d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -50,3 +50,6 @@ jobs: env: DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} + +permissions: + contents: write \ No newline at end of file From 0b9b944bf2b3b2942ceda16cb5b1b8702c3c3586 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 16 Sep 2024 23:16:05 +0000 Subject: [PATCH 8/8] ci: version bump 1.0.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa88d0c..59b5f31 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ edu.stanford.protege webprotege-linearization-service - 1.0.4 + 1.0.5 webprotege-linearization-service This service reads linearization documents from cloud storage (using MinIO) and, from these, generates WebProtégé linearization. Also, it handles querying and event sourcing