Skip to content

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
os:
- windows-2019
- ubuntu-22.04
- macos-12
steps:
- uses: actions/checkout@v4
# Setup
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17.0.8'
distribution: 'temurin'
cache: maven
- name: maven-settings-xml-action
uses: InstaCode/maven-settings-xml-action@v9
with:
servers: '[{ "id": "github", "username": "zaro", "password": "${{ secrets.JDDE_PACKAGES_TOKEN }}" }]'
- name: Check maven settings
run: "cat 'C:\\Users\\runneradmin\\.m2\\settings.xml'"
# Build
- name: Build with Maven
env:
PME_LICENSE: ${{ secrets.PME_LICENSE }}
SIGNTOOL_CERT: ${{ secrets.SIGNTOOL_CERT }}
run: mvn -B package --file pom.xml
# Publish
- name: Get Version
uses: entimaniac/[email protected]
id: getVersion
- name: Remove packaging garbage
if: ${{ startsWith( matrix.os, 'macos' ) }}
run: rm -f target/packages/default._*.dmg
- name: Make sure we release JAR file from only one OS
if: ${{ !startsWith( matrix.os, 'ubuntu' ) }}
run: rm -f target/packages/*.jar
shell: bash
- uses: actions/upload-artifact@v4
with:
name: release-files-${{ matrix.os }}
path: target/packages/* # or path/to/artifact
release:
permissions:
contents: write
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: true
files: |
release-files-*/*
# # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6