Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to rsync #5778

Merged
merged 4 commits into from
Dec 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 62 additions & 15 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,10 +23,10 @@ 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: Build for ${{ matrix.displayName }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is build the right terminology since we build the installer and not the application (compilation)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess so as "build" (for me) is to create something. Be it the plain binary, the installer, ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess so as "build" (for me) is to create something. Be it the plain binary, the installer, ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create installer for matrix.os ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also create the portable files. I will then use the longer name containing both.


steps:
- name: Checkout source
Expand All @@ -52,7 +52,9 @@ jobs:
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') }}
Expand All @@ -62,6 +64,8 @@ jobs:
${{ 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') }}
Expand Down Expand Up @@ -98,7 +102,7 @@ jobs:
run: ${{ matrix.archivePortable }}
shell: bash
- name: Build and publish snap
if: matrix.os == 'ubuntu-latest' && steps.gitversion.outputs.branchName == 'master'
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
run: |
Expand All @@ -115,12 +119,55 @@ jobs:
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
deploy:
runs-on: ubuntu-latest
needs: [build]
koppor marked this conversation as resolved.
Show resolved Hide resolved
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/setup-gitversion@v0.3
with:
versionSpec: '5.1.2'
- name: Run GitVersion
id: gitversion
uses: gittools/actions/execute-gitversion@v0.3
- 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/action-rsyncer@v1.1.0
env:
DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }}
BRANCH: ${{ steps.gitversion.outputs.branchName }}
with:
flags: -vaz --itemize-changes --progress --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }} && rsync"
koppor marked this conversation as resolved.
Show resolved Hide resolved
options: ''
ssh_options: '-p 9922'
src: 'build/distribution/'
dest: jrrsync@builds.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/
- name: Display status from deploy
koppor marked this conversation as resolved.
Show resolved Hide resolved
run: echo "${{ steps.deploy.outputs.status }}"