Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
chore: add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
ex0b1t committed Nov 14, 2022
1 parent 0556555 commit e5bce81
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
release:
types:
- published

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Configure Maven
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: '[{ "id": "backbase", "url": "https://repo.backbase.com/repo" }]'
plugin_repositories: '[{ "id": "backbase-plugins", "url": "https://repo.backbase.com/repo" }]'
servers: '[{ "id": "backbase", "username": "${{ secrets.MAVEN_USERNAME }}", "password": "${{ secrets.MAVEN_PASSWORD }}" },{ "id": "backbase-plugins", "username": "${{ secrets.MAVEN_USERNAME }}", "password": "${{ secrets.MAVEN_PASSWORD }}" }]'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Maven Verify
run: mvn -B verify --file pom.xml

publish:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Configure Maven
uses: whelk-io/maven-settings-xml-action@v21
with:
repositories: '[{ "id": "backbase", "url": "https://repo.backbase.com/repo" }]'
plugin_repositories: '[{ "id": "backbase-plugins", "url": "https://repo.backbase.com/repo" }]'
servers: '[{ "id": "backbase", "username": "${{ secrets.MAVEN_USERNAME }}", "password": "${{ secrets.MAVEN_PASSWORD }}" },{ "id": "backbase-plugins", "username": "${{ secrets.MAVEN_USERNAME }}", "password": "${{ secrets.MAVEN_PASSWORD }}" }]'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Update POM Version
run: |
echo "New version is: ${GITHUB_REF##*/v}"
mvn versions:set -DnewVersion=${GITHUB_REF##*/v} -DgenerateBackupPoms=false -B
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build
run: mvn clean package jib:build -Djib.to.image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/v}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>com.backbase.testing</groupId>
<artifactId>event-emitter</artifactId>
<version>1.9.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Backbase :: Testing Components :: Events Emitter</name>

Expand Down

0 comments on commit e5bce81

Please sign in to comment.