Skip to content

Commit

Permalink
update ci separate os jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Jan 29, 2024
1 parent ad60f48 commit db897a4
Showing 1 changed file with 66 additions and 26 deletions.
92 changes: 66 additions & 26 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ jobs:
./mvnw -B -C -V package
ls -lah ./target
- uses: actions/upload-artifact@v4
- name: Create release if tag pushed
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: startsWith(github.ref, 'refs/tags/')
with:
name: deb
path: target/*.deb
draft: true
prerelease: true
files: |
target/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

linux-rpm:
environment: packaging
Expand All @@ -55,23 +61,20 @@ jobs:
./mvnw -B -C -V package
ls -lah ./target
- uses: actions/upload-artifact@v4
- name: Create release if tag pushed
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: startsWith(github.ref, 'refs/tags/')
with:
name: rpm
path: target/*.rpm
draft: true
prerelease: true
files: |
target/*.rpm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
macos:
environment: packaging
runs-on: ${{ matrix.os }}
needs:
- linux-deb
- linux-rpm
strategy:
matrix:
os:
- macos-latest
- windows-latest
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -92,12 +95,11 @@ jobs:
path: |
~/.m2/repository
target/jdkCache
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: macos-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
macos-maven-
- name: Install an Apple keychain (MacOS)
if: runner.os == 'macOS'
# based on https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development#add-a-step-to-your-workflow
env:
APPLE_KEYCHAIN_BASE64: ${{ secrets.APPLE_KEYCHAIN_BASE64 }}
Expand Down Expand Up @@ -128,7 +130,6 @@ jobs:
APPLE_DEVELOPER_IDENTITY: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}

- name: Notarize release with Apple (MacOS)
if: runner.os == 'macOS'
env:
APPLE_KEYCHAIN_PATH: ${{ env.APPLE_KEYCHAIN_PATH }}
shell: bash
Expand All @@ -141,8 +142,51 @@ jobs:
# lock all keychains
security lock-keychain -a
- name: Create release if tag pushed
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: true
files: |
target/*.pkg
target/*.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

windows:
environment: packaging
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: target

- name: Update version in pom if tag pushed
if: startsWith(github.ref, 'refs/tags/')
run: ./mvnw versions:set -DnewVersion=$(git describe --tags --abbrev=0 | sed -r 's/^v//g')
shell: bash

- name: Cache local Maven repository and JDK cache
uses: actions/cache@v3
with:
path: |
~/.m2/repository
target/jdkCache
key: windows-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
windows-maven-
- name: Package with Maven
run: ./mvnw -B -C -V package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Sign on Azure
if: runner.os == 'Windows'
shell: bash
run: |
dotnet tool install --global AzureSignTool
Expand All @@ -157,9 +201,5 @@ jobs:
files: |
target/*.exe
target/*.msi
target/*.rpm
target/*.deb
target/*.pkg
target/*.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit db897a4

Please sign in to comment.