Skip to content

Deploy workflow

Deploy workflow #3

Workflow file for this run

name: Deploy with Maven
on:
workflow_dispatch:
push:
branches: [ "*" ]
jobs:
build_test:
uses: ./.github/workflows/maven.yml
deploy:
needs: build_test
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/maven-settings-action@v3.1.0
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
create_tag:
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
cache: maven
- name: Get version
id: get_version
run: mvn -f jgpio/pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{steps.get_version.outputs.stdout}}',
sha: context.sha
})