Skip to content

Commit

Permalink
Speedup "deployment" (to builds.jabref.org) (JabRef#10051)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jul 1, 2023
1 parent 52e2adc commit 21111c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ jobs:
--file-associations buildres/mac/bibtexAssociations.properties \
--jlink-options --bind-services
- name: Build pkg (macos)
if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES')
shell: bash
run: |
${{env.JDK21}}/Contents/Home/bin/jpackage \
Expand Down Expand Up @@ -166,8 +165,7 @@ jobs:
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Deploy to builds.jabref.org
id: deploy
- name: Upload to builds.jabref.org (TODO - won't run on Mac, because Dockerized action)
uses: Pendect/action-rsyncer@v2.0.0
env:
DEPLOY_KEY: ${{ secrets.buildJabRefPrivateKey }}
Expand Down
45 changes: 26 additions & 19 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
java-version: 20
distribution: 'temurin'
cache: 'gradle'
- name: setup jdk JabRef-fix windows
- name: setup jdk JabRef-fix (windows)
if: (matrix.os == 'windows-latest')
shell: bash
run: |
Expand All @@ -101,7 +101,7 @@ jobs:
cat gradle.properties
sed -i "s/JavaLanguageVersion.of(20)/JavaLanguageVersion.of(21)/" build.gradle
- name: setup jdk JabRef-fix ubuntu
- name: setup jdk JabRef-fix (ubuntu)
if: (matrix.os == 'ubuntu-latest')
shell: bash
run: |
Expand All @@ -115,7 +115,7 @@ jobs:
cat gradle.properties
sed -i "s/JavaLanguageVersion.of(20)/JavaLanguageVersion.of(21)/" build.gradle
- name: setup jdk JabRef-fix mac
- name: setup jdk JabRef-fix (macos)
if: (matrix.os == 'macos-latest')
shell: bash
run: |
Expand All @@ -130,14 +130,14 @@ jobs:
cat gradle.properties
sed -i'.bak' -e "s/JavaLanguageVersion.of(20)/JavaLanguageVersion.of(21)/" build.gradle
- name: Setup OSX key chain on OSX
- name: Setup OSX key chain (macos)
if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES')
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.OSX_SIGNING_CERT }}
p12-password: ${{ secrets.OSX_CERT_PWD }}
keychain-password: jabref
- name: Setup OSX key chain on OSX for app id cert
- name: Setup OSX key chain on OSX for app id cert (macos)
if: (matrix.os == 'macos-latest') && (steps.checksecrets.outputs.secretspresent == 'YES')
uses: apple-actions/import-codesign-certs@v2
with:
Expand Down Expand Up @@ -222,8 +222,20 @@ jobs:
ar -m -c -a sdsd jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb debian-binary control.tar.xz data.tar.xz
rm debian-binary control.tar.* data.tar.*
mv -f jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64_repackaged.deb jabref_${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}_amd64.deb
- name: Upload to GitHub workflow artifacts store (non-macos)
if: (matrix.os != 'macos-latest')
- name: Upload to builds.jabref.org (ubuntu)
if: (matrix.os == 'ubuntu-latest') && (steps.checksecrets.outputs.secretspresent == 'YES')
uses: Pendect/action-rsyncer@v2.0.0
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: jrrsync@build-upload.jabref.org:/var/www/builds.jabref.org/www/${{ steps.gitversion.outputs.branchName }}/
- name: Upload to GitHub workflow artifacts store (windows)
if: (matrix.os == 'windows-latest')
uses: actions/upload-artifact@v3
with:
name: JabRef-${{ matrix.displayName }}
Expand Down Expand Up @@ -293,10 +305,10 @@ jobs:
with:
name: JabRef-macOS
path: build/distribution
deploy:
upload:
strategy:
fail-fast: false
name: Deploy binaries on builds.jabref.org
name: Upload binaries on builds.jabref.org
runs-on: ubuntu-latest
needs: [build, notarize]
steps:
Expand Down Expand Up @@ -326,32 +338,27 @@ jobs:
if: steps.checksecrets.outputs.secretspresent == 'YES'
id: gitversion
uses: gittools/actions/gitversion/execute@v0.10.2
- name: Get linux binaries
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: actions/download-artifact@master
with:
name: JabRef-linux
path: build/distribution
- name: Get windows binaries
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: actions/download-artifact@master
with:
name: JabRef-windows
path: build/distribution
- name: Get macOS binaries unsigned
if: steps.checksecrets.outputs.secretspresent == 'YES' && ! (${{ inputs.notarization }})) && ! (startsWith(github.ref, 'refs/tags/')
if: (steps.checksecrets.outputs.secretspresent == 'YES') && ! (${{ inputs.notarization }})) && ! (startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@master
with:
name: JabRef-macOS-tbn
path: build/distribution/
- name: Get macOS binaries notarized
if: (startsWith(github.ref, 'refs/tags/') || (${{ inputs.notarization }})) && (steps.checksecrets.outputs.secretspresent == 'YES')
if: (steps.checksecrets.outputs.secretspresent == 'YES') && ((${{ inputs.notarization }})) || (startsWith(github.ref, 'refs/tags/'))
uses: actions/download-artifact@master
with:
name: JabRef-macOS
path: build/distribution/
- name: Deploy to builds.jabref.org
id: deploy
# Upload to build server using rsync
# The action runs on linux only (because it is a Dockerized action), therefore it is embedded in a separate workflow
- name: Upload to builds.jabref.org
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: Pendect/action-rsyncer@v2.0.0
env:
Expand Down

0 comments on commit 21111c5

Please sign in to comment.