vZome desktop build #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] | |
runs-on: '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/[email protected] | |
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 | |