Skip to content

Release

Release #29

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out
- name: Get Maven project version
run: |
echo "project_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec --file pom-dist.xml)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Install gpg secret key
id: install-secret-key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Install gpg public key
id: install-pulic-key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_PUBLIC_KEY }}") | gpg --batch --import
gpg --list-public-keys --keyid-format LONG
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build with Maven (Java 8)
run: mvn -B package --file pom.xml
- name: Clean target
run: rm -r target
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Publish package
run: mvn --batch-mode "-Dprod.build=true" -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} clean deploy --file pom-dist.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: List target directory
run: ls -l target
- name: Copy dist artifacts to staging directory
run: mkdir staging && cp target/*.jar staging
- name: create bundle .zip
run: cd staging && zip JTOpen-$project_version.zip *.jar && cd ..
- name: Create the tag and release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.project_version }}
name: v${{ env.project_version }}
files: |
staging/jt400-*.jar
staging/*.zip