-
Notifications
You must be signed in to change notification settings - Fork 8
174 lines (161 loc) · 5.86 KB
/
desktop.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# This is a basic workflow that is manually triggered
name: vZome desktop build
on:
workflow_dispatch:
env:
BUILD_NUMBER: ${{ github.run_number }}
GIT_COMMIT: ${{ github.sha }}
# TODO connect these to secrets
# NOTE: They have nothing to do with running this GitHub Action;
# they are for vZome to make runtime API calls to GitHub.
GITHUB_CLIENT_SECRET: ${{ secrets.VZOME_GITHUB_CLIENT_SECRET }}
GITHUB_CLIENT_ID: ${{ secrets.VZOME_GITHUB_CLIENT_ID }}
jobs:
build-macos:
strategy:
matrix:
arch: [intel, arm64]
# macos-13 is an Intel image, apparently, whereas macos-latest is the latest Arm64
runs-on: ${{ matrix.arch == 'intel' && 'macos-13' || 'macos-latest' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Control Timezone
uses: szenius/set-timezone@v1.1
with:
timezoneMacos: "America/Los_Angeles"
- name: Get current date
run: date
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
SIGNING_KEYCHAIN: build.keychain
run: |
echo $MACOS_CERTIFICATE | base64 -D > certificate.p12
security create-keychain -p KeychainPwd $SIGNING_KEYCHAIN
security default-keychain -s $SIGNING_KEYCHAIN
security unlock-keychain -p KeychainPwd $SIGNING_KEYCHAIN
security import certificate.p12 -k $SIGNING_KEYCHAIN -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k KeychainPwd $SIGNING_KEYCHAIN
./gradlew --info clean jpackage
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/dreamhost.key
chmod 600 ~/.ssh/dreamhost.key
cat >>~/.ssh/config <<END
Host dreamhost
HostName $HOSTING_FQDN
User scottvorthmann
IdentityFile ~/.ssh/dreamhost.key
StrictHostKeyChecking no
END
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTING_FQDN: ${{ secrets.HOSTING_FQDN }}
- name: Publish MacOS build to DreamHost
run: |
source desktop/build/buildPropsResource/build.properties # to set the version and buildNumber variables
sftp -b - dreamhost <<END
cd vzome.com/download/${version}/
-mkdir ${buildNumber}
cd ${buildNumber}
-mkdir mac
cd mac
put desktop/build/jpackage/vZome-${version}.${buildNumber}.dmg vZome-${version}.${buildNumber}-${{ matrix.arch }}.dmg
END
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
./gradlew clean jpackage
ls desktop/build/jpackage
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/dreamhost.key
chmod 600 ~/.ssh/dreamhost.key
cat >>~/.ssh/config <<END
Host dreamhost
HostName $HOSTING_FQDN
User scottvorthmann
IdentityFile ~/.ssh/dreamhost.key
StrictHostKeyChecking no
END
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTING_FQDN: ${{ secrets.HOSTING_FQDN }}
- name: Publish Linux build to DreamHost
run: |
source desktop/build/buildPropsResource/build.properties # to set the version variable
sftp -b - dreamhost <<END
cd vzome.com/download/${version}/
-mkdir ${{ github.run_number }}
cd ${{ github.run_number }}
-mkdir linux
cd linux
mput desktop/build/jpackage/vzome_*.deb
END
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Build with Gradle
run: |
./gradlew -i clean jpackage
ls desktop/build/jpackage
- name: Archive Windows build
uses: actions/upload-artifact@v3
with:
name: vZome-Windows-7.1.${{ github.run_number }}
path: desktop/build/jpackage/vZome-*.exe
- name: Configure SSH
run: |
mkdir -p $env:USERPROFILE/.ssh/
echo "$SSH_KEY" > $env:USERPROFILE/.ssh/dreamhost.key
echo "" >> $env:USERPROFILE/.ssh/dreamhost.key
echo 'Host dreamhost' > $env:USERPROFILE/.ssh/config
echo " HostName $HOSTING_FQDN" >> $env:USERPROFILE/.ssh/config
echo ' User scottvorthmann' >> $env:USERPROFILE/.ssh/config
echo " IdentityFile $env:USERPROFILE\.ssh\dreamhost.key" >> $env:USERPROFILE/.ssh/config
echo ' StrictHostKeyChecking no' >> $env:USERPROFILE/.ssh/config
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY_WINDOWS }}
HOSTING_FQDN: ${{ secrets.HOSTING_FQDN }}
- name: Publish Windows build to DreamHost
run: |
echo "cd vzome.com/download/${version}/" >> batchfile.txt
echo "-mkdir ${{ github.run_number }}" >> batchfile.txt
echo "cd ${{ github.run_number }}" >> batchfile.txt
echo "-mkdir win" >> batchfile.txt
echo "cd win" >> batchfile.txt
echo "mput desktop/build/jpackage/vZome-*.exe" >> batchfile.txt
sftp -b batchfile.txt dreamhost