Skip to content

Commit

Permalink
Use Github Actions for deployment (#5312)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tobiasdiez authored Sep 26, 2019
1 parent 1a6c92c commit 124fadb
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 238 deletions.
85 changes: 0 additions & 85 deletions .circleci/config.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Deployment

on: [push]

jobs:
deploy:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
displayName: linux
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_linux-x64_bin.tar.gz
jdk14Path: /jdk-14
archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef
- os: windows-latest
displayName: windows
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip
jdk14Path: /jdk-14
archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef
- os: macOS-latest
displayName: macOS
jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_osx-x64_bin.tar.gz
jdk14Path: /jdk-14.jdk/Contents/Home
archivePortable: tar -czf build/distribution/JabRef-portable_macos.tar.gz -C build/distribution JabRef.app && rm -R build/distribution/JabRef.app

runs-on: ${{ matrix.os }}
name: Deploy on ${{ matrix.displayName }}

steps:
- name: Checkout source
uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11.0.4
- name: Download jpackage
# We need to download jpackage from https://jdk.java.net/jpackage/
run: |
import tarfile
import zipfile
import sys
if sys.version_info[0] >= 3:
from urllib.request import urlretrieve
else:
from urllib import urlretrieve
url = "${{ matrix.jpackageDownload }}"
tmpfile, headers = urlretrieve(url)
if (url.endswith("tar.gz")):
tar = tarfile.open(tmpfile)
tar.extractall()
tar.close()
elif (url.endswith("zip")):
zip = zipfile.ZipFile(tmpfile)
zip.extractall()
zip.close()
shell: python
- name: Build runtime image
run: ./gradlew -Pdev=true jlinkZip
- name: Build installer
run: |
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
./gradlew -Pdev=true jpackage
shell: bash
- name: Add installer as artifact
uses: actions/upload-artifact@master
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Package application image
run: ${{ matrix.archivePortable }}
shell: bash
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Upload to builds.jabref.org
uses: garygrossgarten/github-action-scp@release
with:
local: build/distribution
remote: www/${{ steps.extract_branch.outputs.branch }}
host: builds.jabref.org
username: builds_jabref_org
privateKey: ${{ secrets.buildJabRefPrivateKey }}
port: 9922
Loading

0 comments on commit 124fadb

Please sign in to comment.