Skip to content

maven-release

maven-release #77

Workflow file for this run

name: maven-release
on:
workflow_dispatch:
inputs:
version:
required: true
default: 'X.X.X.RCX'
docker:
required: true
type: choice
options:
- 'enabled'
- 'disabled'
jobs:
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: set up jdk 17
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
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: set maven version
run: |
mvn versions:set versions:commit -B -ntp -DnewVersion=${{ github.event.inputs.version }}
- name: docker build
if: ( github.event.inputs.docker == 'enabled' )
run: |
mvn clean install -B -ntp -DskipTests -P pre-release
./build-docker.sh
- name: docker login
if: ( github.event.inputs.docker == 'enabled' )
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker push
if: ( github.event.inputs.docker == 'enabled' )
run: |
docker tag karate-chrome karatelabs/karate-chrome:${{ github.event.inputs.version }}
docker tag karate-chrome karatelabs/karate-chrome:latest
docker push karatelabs/karate-chrome:${{ github.event.inputs.version }}
docker push karatelabs/karate-chrome:latest
- name: maven deploy to central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
mvn -B -ntp deploy -DskipTests -P pre-release,release
- name: maven build binaries
run: |
mvn package -DskipTests -P fatjar -f karate-core/pom.xml
mvn package -DskipTests -P fatjar -f karate-robot/pom.xml
- name: upload binaries
uses: actions/upload-artifact@v4
with:
name: karate-release-${{ github.event.inputs.version }}
retention-days: 5
path: |
karate-core/target/*.jar
karate-robot/target/*.jar