Skip to content

Commit

Permalink
Deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mk868 committed Nov 6, 2024
1 parent 6fb959f commit 26a5e3d
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Java CI with Maven

on:
push:
branches: [ "main" ]
branches: [ "main", "deploy" ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -69,3 +71,45 @@ jobs:
run: |
mvn -B -f jgpio/pom.xml jar:jar install:install
mvn -B -f jgpio-it/pom.xml verify
deploy:
needs: [ build, test-it ]
if: startsWith(github.event.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
cache: maven

- uses: s4u/[email protected]
with:
servers: |
[{
"id": "central",
"username": "${{ secrets.CENTRAL_USERNAME }}",
"password": "${{ secrets.CENTRAL_TOKEN }}"
}]
- name: Cache jextract
id: cache-jextract
uses: actions/cache@v4
with:
path: jextract
key: 22-jextract+5-33

- name: Set up jextract
if: steps.cache-jextract.outputs.cache-hit != 'true'
run: ./prepare-jextract.sh

- name: Deploy with Maven
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
run: |
./prepare.sh
mvn -B -ntp -f jgpio/pom.xml -P release deploy -DskipTests -Dgpg.signer=bc -Djextract.bin=../jextract/bin/jextract

0 comments on commit 26a5e3d

Please sign in to comment.