@@ -29,96 +29,96 @@ jobs:
29
29
name : Create installer and portable version for ${{ matrix.displayName }}
30
30
31
31
steps :
32
- - name : Checkout source
33
- uses : actions/checkout@v2-beta
34
- with :
35
- fetch-depth : 0
36
- - name : Fetch tags and master for GitVersion
37
- run : |
38
- git fetch --tags origin
39
- git rev-parse --verify master
40
- if (-not $?) {
41
- git branch --force --create-reflog master origin/master
42
- }
43
- shell : pwsh
44
- - name : Install GitVersion
45
- uses : gittools/actions/setup-gitversion@v0.3
46
- with :
47
- versionSpec : ' 5.1.2'
48
- - name : Run GitVersion
49
- id : gitversion
50
- uses : gittools/actions/execute-gitversion@v0.3
51
- - name : Set up JDK
52
- uses : actions/setup-java@v1
53
- with :
54
- java-version : 13
55
- # configuration based on https://github.com/actions/cache/blob/master/examples.md#java---gradle
56
- - uses : actions/cache@v1
57
- name : Restore gradle cache
58
- with :
59
- path : ~/.gradle/caches
60
- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
61
- restore-keys : |
62
- ${{ runner.OS }}-gradle-${{ env.cache-name }}-
63
- ${{ runner.OS }}-gradle-
64
- ${{ runner.OS }}-
65
- - uses : actions/cache@v1
66
- name : Cache gradle wrapper
67
- # cache at Mac OS X is 2 GB (too large)
68
- if : matrix.displayName == 'linux' || matrix.displayName == 'windows'
69
- with :
70
- path : ~/.gradle/wrapper
71
- key : ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
72
- - name : Download jpackage
73
- # We need to download jpackage from https://jdk.java.net/jpackage/
74
- run : |
75
- import tarfile
76
- import zipfile
77
- import sys
78
- if sys.version_info[0] >= 3:
79
- from urllib.request import urlretrieve
80
- else:
81
- from urllib import urlretrieve
32
+ - name : Checkout source
33
+ uses : actions/checkout@v2-beta
34
+ with :
35
+ fetch-depth : 0
36
+ - name : Fetch tags and master for GitVersion
37
+ run : |
38
+ git fetch --tags origin
39
+ git rev-parse --verify master
40
+ if (-not $?) {
41
+ git branch --force --create-reflog master origin/master
42
+ }
43
+ shell : pwsh
44
+ - name : Install GitVersion
45
+ uses : gittools/actions/setup-gitversion@v0.3
46
+ with :
47
+ versionSpec : ' 5.1.2'
48
+ - name : Run GitVersion
49
+ id : gitversion
50
+ uses : gittools/actions/execute-gitversion@v0.3
51
+ - name : Set up JDK
52
+ uses : actions/setup-java@v1
53
+ with :
54
+ java-version : 13
55
+ # configuration based on https://github.com/actions/cache/blob/master/examples.md#java---gradle
56
+ - uses : actions/cache@v1
57
+ name : Restore gradle cache
58
+ with :
59
+ path : ~/.gradle/caches
60
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
61
+ restore-keys : |
62
+ ${{ runner.OS }}-gradle-${{ env.cache-name }}-
63
+ ${{ runner.OS }}-gradle-
64
+ ${{ runner.OS }}-
65
+ - uses : actions/cache@v1
66
+ name : Cache gradle wrapper
67
+ # cache at Mac OS X is 2 GB (too large)
68
+ if : matrix.displayName == 'linux' || matrix.displayName == 'windows'
69
+ with :
70
+ path : ~/.gradle/wrapper
71
+ key : ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
72
+ - name : Download jpackage
73
+ # We need to download jpackage from https://jdk.java.net/jpackage/
74
+ run : |
75
+ import tarfile
76
+ import zipfile
77
+ import sys
78
+ if sys.version_info[0] >= 3:
79
+ from urllib.request import urlretrieve
80
+ else:
81
+ from urllib import urlretrieve
82
82
83
- url = "${{ matrix.jpackageDownload }}"
84
- tmpfile, headers = urlretrieve(url)
85
- if (url.endswith("tar.gz")):
86
- tar = tarfile.open(tmpfile)
87
- tar.extractall()
88
- tar.close()
89
- elif (url.endswith("zip")):
90
- zip = zipfile.ZipFile(tmpfile)
91
- zip.extractall()
92
- zip.close()
93
- shell : python
94
- - name : Build runtime image
95
- run : ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip
96
- - name : Build installer
97
- run : |
98
- export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
99
- ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
100
- shell : bash
101
- - name : Package application image
102
- run : ${{ matrix.archivePortable }}
103
- shell : bash
104
- - name : Build and publish snap
105
- if : matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
106
- env :
107
- SNAPCRAFT_LOGIN_FILE : ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
108
- run : |
109
- mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
110
- 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"
111
- shell : bash
112
- - name : Rename files
113
- run : |
114
- get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
115
- get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"}
116
- shell : pwsh
117
- - name : Upload to GitHub workflow artifacts store
118
- uses : actions/upload-artifact@master
119
- with :
120
- name : JabRef-${{ matrix.displayName }}
121
- path : build/distribution
83
+ url = "${{ matrix.jpackageDownload }}"
84
+ tmpfile, headers = urlretrieve(url)
85
+ if (url.endswith("tar.gz")):
86
+ tar = tarfile.open(tmpfile)
87
+ tar.extractall()
88
+ tar.close()
89
+ elif (url.endswith("zip")):
90
+ zip = zipfile.ZipFile(tmpfile)
91
+ zip.extractall()
92
+ zip.close()
93
+ shell : python
94
+ - name : Build runtime image
95
+ run : ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip
96
+ - name : Build installer
97
+ run : |
98
+ export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
99
+ ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
100
+ shell : bash
101
+ - name : Package application image
102
+ run : ${{ matrix.archivePortable }}
103
+ shell : bash
104
+ - name : Build and publish snap
105
+ if : matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
106
+ env :
107
+ SNAPCRAFT_LOGIN_FILE : ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
108
+ run : |
109
+ mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
110
+ 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"
111
+ shell : bash
112
+ - name : Rename files
113
+ run : |
114
+ get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
115
+ get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"}
116
+ shell : pwsh
117
+ - name : Upload to GitHub workflow artifacts store
118
+ uses : actions/upload-artifact@master
119
+ with :
120
+ name : JabRef-${{ matrix.displayName }}
121
+ path : build/distribution
122
122
deploy :
123
123
name : Deploy binaries on builds.jabref.org
124
124
runs-on : ubuntu-latest
0 commit comments