forked from yermak/AudioBookConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_binaries.yml
105 lines (81 loc) · 3.51 KB
/
build_binaries.yml
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
pr: none
trigger:
branches:
include:
- development
variables:
VERSION: 99.99
BUILD_COUNTER: $[counter(variables['VERSION'], 0)]
APP_VERSION: '$(VERSION).$(BUILD_COUNTER)'
jobs:
- job: Build_All
strategy:
matrix:
linux:
imageName: 'ubuntu-18.04'
mac:
imageName: 'macos-10.15'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- checkout: self
clean: 'true'
fetchDepth: '1'
persistCredentials: true
- task: replacetokens@3
inputs:
targetFiles: 'pom.xml,src/main/java/uk/yermak/audiobookconverter/Version.java, version.txt'
tokenPrefix: '#{'
tokenSuffix: '}#'
- bash: |
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get install adoptopenjdk-16-hotspot
sudo apt-get install ffmpeg
sudo apt-get install mp4v2-utils
export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64
export JAVAFX_JMODS=jmods/linux
mvn clean package --no-transfer-progress
build/linux/package.sh $JAVA_HOME $JAVAFX_JMODS $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Build deb package'
- bash: |
wget -q https://download.java.net/java/GA/jdk16.0.2/d4a915d82b4c4fbb9bde534da945d746/7/GPL/openjdk-16.0.2_osx-x64_bin.tar.gz -O openjdk-16.0.2_osx-x64_bin.tar.gz
tar -xzf openjdk-16.0.2_osx-x64_bin.tar.gz
sudo mv jdk-16.0.2.jdk /Library/Java/JavaVirtualMachines/
rm openjdk-16.0.2_osx-x64_bin.tar.gz
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
brew install ffmpeg
brew install mp4v2
export JAVAFX_JMODS=jmods/mac
mvn clean package --no-transfer-progress
$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:$JAVAFX_JMODS \
--add-modules java.base,java.sql,javafx.controls,javafx.fxml,javafx.media,javafx.base,javafx.swing,javafx.graphics --output target/fx-jre
$JAVA_HOME/bin/jpackage --app-version $(APP_VERSION) --license-file LICENSE --icon AudioBookConverter.icns \
--type dmg \
--input target/package/audiobookconverter-$(APP_VERSION)-mac-installer/audiobookconverter-$(APP_VERSION)/app \
--main-jar lib/audiobookconverter-$(APP_VERSION).jar --runtime-image target/fx-jre --java-options '--enable-preview'
mkdir target/release
mv -f *.dmg target/release
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: 'Build dmg package'
- script: |
ECHO ON
choco install 7zip --no-progress
choco install wget --no-progress
wget -q https://download.java.net/java/GA/jdk16.0.2/d4a915d82b4c4fbb9bde534da945d746/7/GPL/openjdk-16.0.2_windows-x64_bin.zip -O openjdk-16.0.2_windows-x64_bin.zip
7z.exe x openjdk-16.0.2_windows-x64_bin.zip
setx JAVA_HOME jdk-16.0.2
call refreshenv
SET JAVAFX_JMODS=jmods/windows
call mvn clean package --no-transfer-progress
call build/windows/package.bat "%JAVA_HOME%" %JAVAFX_JMODS% $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Build MSI installers'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'target/release'
ArtifactName: 'AudioBookConverter-$(APP_VERSION)'
publishLocation: 'Container'