-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (104 loc) · 3.4 KB
/
Copy pathinstallers.yml
File metadata and controls
117 lines (104 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2018-2026 BioInception PVT LTD
name: Native Installers
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-installers:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
type: dmg
jpackage_type: dmg
- os: windows-latest
type: msi
jpackage_type: msi
- os: ubuntu-latest
type: deb
jpackage_type: deb
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4.3.1
- name: Set up JDK 25
uses: actions/setup-java@v4.8.0
with:
distribution: temurin
java-version: '25'
cache: maven
- name: Build CLI JAR
run: mvn -U -B -DskipTests=true clean install package
shell: bash
- name: Extract version
id: version
run: echo "ver=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
shell: bash
- name: Prepare app icon
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
mkdir -p icon.iconset
for sz in 16 32 128 256 512; do
sips -z $sz $sz icons/icon.png --out icon.iconset/icon_${sz}x${sz}.png
done
iconutil -c icns icon.iconset -o icons/icon.icns
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then
magick icons/icon.png -define icon:auto-resize=256,128,64,48,32,16 icons/icon.ico 2>/dev/null || true
fi
shell: bash
- name: Create native installer (jpackage)
run: |
ICON_OPT=""
if [[ -f icons/icon.icns ]]; then
ICON_OPT="--icon icons/icon.icns"
elif [[ -f icons/icon.ico ]]; then
ICON_OPT="--icon icons/icon.ico"
elif [[ -f icons/icon.png ]]; then
ICON_OPT="--icon icons/icon.png"
fi
jpackage \
--input target \
--main-jar smsd-${{ steps.version.outputs.ver }}-jar-with-dependencies.jar \
--name "SMSD Pro" \
--app-version "${{ steps.version.outputs.ver }}" \
--vendor "BioInception PVT LTD" \
--copyright "Copyright 2018-2026 Syed Asad Rahman - BioInception PVT LTD" \
--description "Substructure & MCS Search for Chemical Graphs" \
--type ${{ matrix.jpackage_type }} \
--dest dist/ \
--java-options "-Xmx512m" \
--java-options "--add-opens=java.base/java.lang=ALL-UNNAMED" \
$ICON_OPT
shell: bash
- uses: actions/upload-artifact@v4.6.2
with:
name: installer-${{ matrix.type }}
path: dist/*
attach-to-release:
needs: build-installers
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4.3.0
with:
name: installer-dmg
path: dist
- uses: actions/download-artifact@v4.3.0
with:
name: installer-msi
path: dist
- uses: actions/download-artifact@v4.3.0
with:
name: installer-deb
path: dist
- name: List installers
run: find dist -type f | sort
- name: Attach to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.ref_name }}" dist/* \
--repo "${{ github.repository }}" --clobber || true