Skip to content

Commit 124fadb

Browse files
authored
Use Github Actions for deployment (#5312)
* Initial try * Update gradle.yml * Post to build.jabref.org * Update gradle.yml * Delete upload-to-builds.jabref.org.sh * Delete config.yml * Update gradle.yml * Set Java to 13.0.3 * Try to really set Java to 13 * Does JDK 1.12 work? * Uncomment installer related stuff * Use jpackage * Fix ? build * We are using python 3 apparently * Or not... * Ah, we are on both at the same time... * Fix path to jpackage * Cleanup * Dont stop trying... * Debug... * try to fix path to jpackage * Add baces * Set environment variable properly * Well... * Dudadud... * This is fun... * Set enviornment variable directly * This is going to be somewhat frusting... * I feel like I'm learning a lot about shell syntax today * Spaces are bad? * C'mon... * Fix paths? * This shoud work now... * Zips are not tars, thats suprising * Try with url * Make pretty * Remove debugging output * Rename gradle.yml to depoyment.yml * Rename depoyment.yml to deployment.yml * Update build.gradle * Fix build * Does uploading works now? * Improve installer for windows * Remove install4j and shadowjar from gradle * Change hostname from build-upload to build * Does scp work? * Deploy to branch folder * Archive portable version before upload * Put in distribution folder * Beautify on linux and mac * Update build.gradle * Update build.gradle * Fix folder structure in archive * Try to fix dev version string in about dialog * Remove oss.soatype.org since this is constantly failing lately * Add dev switch
1 parent 1a6c92c commit 124fadb

File tree

4 files changed

+159
-238
lines changed

4 files changed

+159
-238
lines changed

.circleci/config.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/deployment.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Deployment
2+
3+
on: [push]
4+
5+
jobs:
6+
deploy:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, windows-latest, macOS-latest]
11+
include:
12+
- os: ubuntu-latest
13+
displayName: linux
14+
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_linux-x64_bin.tar.gz
15+
jdk14Path: /jdk-14
16+
archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef
17+
- os: windows-latest
18+
displayName: windows
19+
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip
20+
jdk14Path: /jdk-14
21+
archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef
22+
- os: macOS-latest
23+
displayName: macOS
24+
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_osx-x64_bin.tar.gz
25+
jdk14Path: /jdk-14.jdk/Contents/Home
26+
archivePortable: tar -czf build/distribution/JabRef-portable_macos.tar.gz -C build/distribution JabRef.app && rm -R build/distribution/JabRef.app
27+
28+
runs-on: ${{ matrix.os }}
29+
name: Deploy on ${{ matrix.displayName }}
30+
31+
steps:
32+
- name: Checkout source
33+
uses: actions/checkout@v1
34+
- name: Set up JDK
35+
uses: actions/setup-java@v1
36+
with:
37+
java-version: 11.0.4
38+
- name: Download jpackage
39+
# We need to download jpackage from https://jdk.java.net/jpackage/
40+
run: |
41+
import tarfile
42+
import zipfile
43+
import sys
44+
if sys.version_info[0] >= 3:
45+
from urllib.request import urlretrieve
46+
else:
47+
from urllib import urlretrieve
48+
49+
url = "${{ matrix.jpackageDownload }}"
50+
tmpfile, headers = urlretrieve(url)
51+
if (url.endswith("tar.gz")):
52+
tar = tarfile.open(tmpfile)
53+
tar.extractall()
54+
tar.close()
55+
elif (url.endswith("zip")):
56+
zip = zipfile.ZipFile(tmpfile)
57+
zip.extractall()
58+
zip.close()
59+
shell: python
60+
- name: Build runtime image
61+
run: ./gradlew -Pdev=true jlinkZip
62+
- name: Build installer
63+
run: |
64+
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
65+
./gradlew -Pdev=true jpackage
66+
shell: bash
67+
- name: Add installer as artifact
68+
uses: actions/upload-artifact@master
69+
with:
70+
name: JabRef-${{ matrix.displayName }}
71+
path: build/distribution
72+
- name: Package application image
73+
run: ${{ matrix.archivePortable }}
74+
shell: bash
75+
- name: Extract branch name
76+
shell: bash
77+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
78+
id: extract_branch
79+
- name: Upload to builds.jabref.org
80+
uses: garygrossgarten/github-action-scp@release
81+
with:
82+
local: build/distribution
83+
remote: www/${{ steps.extract_branch.outputs.branch }}
84+
host: builds.jabref.org
85+
username: builds_jabref_org
86+
privateKey: ${{ secrets.buildJabRefPrivateKey }}
87+
port: 9922

0 commit comments

Comments
 (0)