-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into changemergesdialog
* upstream/master: Fixes StringIndexOutOfBoundsException when cutting text (#5776) Bump org.beryx.jlink from 2.16.4 to 2.17.0 (#5782) Bump byte-buddy-parent from 1.10.5 to 1.10.6 (#5783) Fix line endings. Try to use implicit shell to enable variable correctly be set Fix branch name detection Update script to absolute path and new username Revert "Disable non-working cleanup_pr workflow" Switch to rsync (#5778) Fix Medline tests (#5774) Normalize line ending in test file (#5775) Fix Springer fetcher tests (#5773) Fix code style (#5772)
- Loading branch information
Showing
12 changed files
with
239 additions
and
157 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Cleanup after PR | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Extract branch name | ||
id: extract_branch | ||
run: | | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
- name: Delete folder on builds.jabref.org | ||
uses: appleboy/[email protected] | ||
with: | ||
script: rm -rf /var/www/builds.jabref.org/www/${{ steps.extract_branch.outputs.branch }} | ||
host: builds.jabref.org | ||
port: 9922 | ||
username: jrrsync | ||
key: ${{ secrets.buildJabRefPrivateKey }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,17 @@ name: Deployment | |
on: [push] | ||
|
||
jobs: | ||
deploy: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
include: | ||
- os: ubuntu-latest | ||
displayName: linux | ||
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_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 | ||
archivePortable: tar -c -C build/distribution JabRef | pigz --rsyncable > build/distribution/JabRef-portable_linux.tar.gz && rm -R build/distribution/JabRef | ||
- os: windows-latest | ||
displayName: windows | ||
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_windows-x64_bin.zip | ||
|
@@ -23,104 +23,150 @@ jobs: | |
displayName: macOS | ||
jpackageDownload: https://download.java.net/java/early_access/jdk14/27/GPL/openjdk-14-ea+27_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 | ||
archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app | ||
|
||
runs-on: ${{ matrix.os }} | ||
name: Deploy on ${{ matrix.displayName }} | ||
name: Create installer and portable version for ${{ matrix.displayName }} | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2-beta | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch tags and master for GitVersion | ||
run: | | ||
git fetch --tags origin | ||
git rev-parse --verify master | ||
if (-not $?) { | ||
git branch --force --create-reflog master origin/master | ||
} | ||
shell: pwsh | ||
- name: Install GitVersion | ||
uses: gittools/actions/[email protected] | ||
with: | ||
versionSpec: '5.1.2' | ||
- name: Run GitVersion | ||
id: gitversion | ||
uses: gittools/actions/[email protected] | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Cache gradle wrapper | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- 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 | ||
- name: Checkout source | ||
uses: actions/checkout@v2-beta | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch tags and master for GitVersion | ||
run: | | ||
git fetch --tags origin | ||
git rev-parse --verify master | ||
if (-not $?) { | ||
git branch --force --create-reflog master origin/master | ||
} | ||
shell: pwsh | ||
- name: Install GitVersion | ||
uses: gittools/actions/[email protected] | ||
with: | ||
versionSpec: '5.1.2' | ||
- name: Run GitVersion | ||
id: gitversion | ||
uses: gittools/actions/[email protected] | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
# configuration based on https://github.com/actions/cache/blob/master/examples.md#java---gradle | ||
- uses: actions/cache@v1 | ||
name: Restore gradle cache | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.OS }}-gradle-${{ env.cache-name }}- | ||
${{ runner.OS }}-gradle- | ||
${{ runner.OS }}- | ||
- uses: actions/cache@v1 | ||
name: Cache gradle wrapper | ||
# cache at Mac OS X is 2 GB (too large) | ||
if: matrix.displayName == 'linux' || matrix.displayName == 'windows' | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
- 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 -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip | ||
- name: Build installer | ||
run: | | ||
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" | ||
./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage | ||
shell: bash | ||
- name: Package application image | ||
run: ${{ matrix.archivePortable }} | ||
shell: bash | ||
- name: Build and publish snap | ||
if: matrix.os == 'ubuntu-latest' && steps.gitversion.outputs.branchName == 'master' | ||
env: | ||
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} | ||
run: | | ||
mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg | ||
docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/ && snapcraft push build/distribution/jabref*.snap --release edge || true" | ||
shell: bash | ||
- name: Rename files | ||
run: | | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} | ||
shell: pwsh | ||
- name: Upload to GitHub workflow artifacts store | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: JabRef-${{ matrix.displayName }} | ||
path: build/distribution | ||
- name: Upload to builds.jabref.org | ||
uses: garygrossgarten/github-action-scp@release | ||
with: | ||
local: build/distribution | ||
remote: www/${{ steps.gitversion.outputs.branchName }} | ||
host: builds.jabref.org | ||
username: builds_jabref_org | ||
privateKey: ${{ secrets.buildJabRefPrivateKey }} | ||
port: 9922 | ||
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 -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip | ||
- name: Build installer | ||
run: | | ||
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" | ||
./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage | ||
shell: bash | ||
- name: Package application image | ||
run: ${{ matrix.archivePortable }} | ||
shell: bash | ||
- name: Build and publish snap | ||
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master' | ||
env: | ||
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} | ||
run: | | ||
mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg | ||
docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/ && snapcraft push build/distribution/jabref*.snap --release edge || true" | ||
shell: bash | ||
- name: Rename files | ||
run: | | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} | ||
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} | ||
shell: pwsh | ||
- name: Upload to GitHub workflow artifacts store | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: JabRef-${{ matrix.displayName }} | ||
path: build/distribution | ||
deploy: | ||
name: Deploy binaries on builds.jabref.org | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2-beta | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch tags and master for GitVersion | ||
run: | | ||
git fetch --tags origin | ||
git rev-parse --verify master | ||
if (-not $?) { | ||
git branch --force --create-reflog master origin/master | ||
} | ||
shell: pwsh | ||
- name: Install GitVersion | ||
uses: gittools/actions/[email protected] | ||
with: | ||
versionSpec: '5.1.2' | ||
- name: Run GitVersion | ||
id: gitversion | ||
uses: gittools/actions/[email protected] | ||
- name: Get linux binaries | ||
uses: actions/download-artifact@master | ||
with: | ||
name: JabRef-linux | ||
path: build/distribution | ||
- name: Get windows binaries | ||
uses: actions/download-artifact@master | ||
with: | ||
name: JabRef-windows | ||
path: build/distribution | ||
- name: Get macOS binaries | ||
uses: actions/download-artifact@master | ||
with: | ||
name: JabRef-macOS | ||
path: build/distribution/ | ||
- name: Deploy to builds.jabref.org | ||
id: deploy | ||
uses: Pendect/[email protected] | ||
env: | ||
DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }} | ||
BRANCH: ${{ steps.gitversion.outputs.branchName }} | ||
with: | ||
flags: -vaz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync" | ||
options: '' | ||
ssh_options: '-p 9922' | ||
src: 'build/distribution/' | ||
dest: [email protected]:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/ |
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 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
Oops, something went wrong.