diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 8f572c312da..5dc7fc4154e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -71,10 +71,50 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - name: Build runtime image run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip + - name: Debug state after build + run: | + find build -name "JabRef*.jar" + shell: bash - name: Build installer run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage shell: bash - - name: Package application image + - name: Save portable jar, fix and output filename of portable jar + id: portablejar + if: matrix.displayName == 'linux' + run: | + mv build/distribution/JabRef/lib/app/mods/JabRef.merged*.jar JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.jar + echo "::set-output name=file::$(ls JabRef*.jar)" + shell: bash + - name: Upload portable jar + if: matrix.displayName == 'linux' + uses: actions/upload-artifact@master + with: + name: JabRef-jar + path: ${{ steps.portablejar.outputs.file }} + # In case the timestamp of a file changes, the tar archive changes, because tar also stores file meta such as the file name and the file creation date. + # Therefore, the gzip file changes. + # Therefore, data needs to be synced by rsync. + # To prevent that, we set the timestamp to something "OKish" (not confiusing users that hard) + # We use "last monday", 00:00 as time stamp + - name: Determine timestamp for build + id: timestampforbuild + run: | + from datetime import datetime + from datetime import date + from datetime import timedelta + lastmonday = date.today().toordinal() + lastmonday = lastmonday - (lastmonday % 7) + 1 + timestamp = datetime.fromordinal(lastmonday).strftime("%y%m%d") + print("::set-output name=timestamp::" + timestamp) + shell: python + - name: Post-process build + # Remove obsolete jar, update timestamps + run: | + find build -name "JabRef*.jar" + find build -name "JabRef*.jar" | xargs rm + find build -type f -exec touch -t ${{ steps.timestampforbuild.outputs.timestamp }}0000 {} \; + shell: bash + - name: Package application image run: ${{ matrix.archivePortable }} shell: bash - name: Rename files @@ -119,6 +159,11 @@ jobs: with: name: JabRef-macOS path: build/distribution/ + - name: Get portable JAR + uses: actions/download-artifact@master + with: + name: JabRef-jar + path: build/distribution/ - name: Deploy to builds.jabref.org id: deploy uses: Pendect/action-rsyncer@v1.1.0