From 0f23698e3fecf9fbe0f7da661ebfc1f2658f1f31 Mon Sep 17 00:00:00 2001 From: Gheorghe Soimu Date: Wed, 25 Sep 2024 17:27:09 +0300 Subject: [PATCH 1/2] added github workflows and changed pom to use exec-maven-plugin for docker build and publish --- .github/workflows/ci.yaml | 22 ++++++++++++++ .github/workflows/release.yaml | 55 ++++++++++++++++++++++++++++++++++ pom.xml | 47 +++++++++++++++++++++-------- 3 files changed, 112 insertions(+), 12 deletions(-) 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..2793d6b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: Verify + +on: + push: + branches-ignore: + - main + +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..73f5528 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,55 @@ +name: Release + +on: + push: + branches: + - main + +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}} + +permissions: + contents: write \ No newline at end of file diff --git a/pom.xml b/pom.xml index ab73771..032f10f 100644 --- a/pom.xml +++ b/pom.xml @@ -142,24 +142,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 68d7bbc2a18c73dd6ac8011e0a07e92197382385 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Wed, 25 Sep 2024 15:26:06 +0000 Subject: [PATCH 2/2] ci: version bump 1.0.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 032f10f..48d3113 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ edu.stanford.protege webprotege-postcoordination-service - 1.0.0 + 1.0.1 webprotege-postcoordination-service This microservice handles saving the post coordination configuration , querying the configuration for a given entity and the configuration of the post coordination table.