-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Switch to rsync #5778
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
Merged
Merged
Switch to rsync #5778
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 }}/ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.