-
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (83 loc) · 2.67 KB
/
windows-compile-installer-sign-release.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
# This workflow will build a Java project with Ant
name: Windows Build Installer with Version
on:
push:
tags:
- 'v*' # Build the app for commits that are tagged starting with 'v' e.g. v1.2.3
# to tag a commit, use "git tag v1.2.3"
# when you then use "git push origin v1.2.3" this workflow will be invoked
jobs:
build-installer:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set VERSION (e.g. 1.0.0) and FULL_VERSION (e.g. 1.0.0-abcdef4)
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
SHORT_SHA=$(git rev-parse --short HEAD)
FULL_VERSION="${VERSION}-${SHORT_SHA}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "FULL_VERSION=${FULL_VERSION}" >> $GITHUB_ENV
shell: bash
- name: Validate version format
run: |
echo ${VERSION}
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version format is incorrect. It should match N.N.N where N is an integer."
exit 1
fi
shell: bash
# - name: Build version ${{ env.VERSION }}
# - uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
java-package: 'jdk+fx'
- name: Build with Ant
run: |
ant -noinput -buildfile build.xml
echo $JAVA_HOME
shell: bash
- name: Run the Windows installer batch file
run: |
cd installer/windows
BuildWin.bat ${{ env.VERSION }}
shell: cmd
- name: Rename exe file with version and architecture
env:
PUBLISH_PATH: 'installer/windows'
run: |
mv ${{env.PUBLISH_PATH}}\LingTree-${{ env.VERSION }}.exe LingTree-${{ env.VERSION }}.exe
- uses: actions/upload-artifact@v4
with:
name: LingTree
path: LingTree-*.exe
if-no-files-found: error
sign-installer:
name: Sign LingTree installer
needs: build-installer
uses: sillsdev/codesign/.github/workflows/sign.yml@v2
with:
artifact: LingTree
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}
create-release:
name: Create Release
needs: sign-installer
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v4
with:
name: LingTree
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: LingTree-*.exe
body: |
Release for version ${{ github.ref }}
draft: true