diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml index 4a3ba630d93..d2ada6c9022 100644 --- a/.github/workflows/snap.yml +++ b/.github/workflows/snap.yml @@ -1,4 +1,4 @@ -name: Snap +name: Snap Nightly on: push: diff --git a/.github/workflows/update-chocolatey-jabref-nightly.yml b/.github/workflows/update-chocolatey-jabref-nightly.yml new file mode 100644 index 00000000000..4f8a44f1609 --- /dev/null +++ b/.github/workflows/update-chocolatey-jabref-nightly.yml @@ -0,0 +1,72 @@ +name: Chocolatey Nightly + +on: + push: + branches: + - chocoDev + schedule: + # run on each day + - cron: '33 5 * * *' + +jobs: + createnightly: + runs-on: ubuntu-latest + steps: + - name: Check secrets presence + id: checksecrets + shell: bash + run: | + if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then + echo ::set-output name=secretspresent::false + else + echo ::set-output name=secretspresent::true + fi + env: + BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} + - name: Make current master version the nightly build version + if: ${{ steps.checksecrets.outputs.secretspresent }} + uses: appleboy/ssh-action@v0.0.6 + with: + script: | + rm /var/www/builds.jabref.org/www/nightly/* || mkdir -p /var/www/builds.jabref.org/www/nightly || true + cp -a /var/www/builds.jabref.org/www/master/JabRef-5.1.msi /var/www/builds.jabref.org/www/nightly/ + cp -a /var/www/builds.jabref.org/www/master/JabRef-5.1-portable_windows.zip /var/www/builds.jabref.org/www/nightly/ + host: build-upload.jabref.org + port: 9922 + username: jrrsync + key: ${{ secrets.buildJabRefPrivateKey }} + createchoco: + needs: createnightly + runs-on: windows-latest + name: Create installer and portable version for chocolatey + steps: + - name: Determine sha256 sums + id: checksum + shell: python + run: | + from urllib.request import urlretrieve + import hashlib + + tmpfile, headers = urlretrieve('https://builds.jabref.org/master/JabRef-5.1.msi') + hash = hashlib.sha256() + with open(tmpfile, "rb") as f: + for chunk in iter(lambda: f.read(4096), b""): + hash.update(chunk) + print(f'::set-output name=secretspresent::{hash.hexdigest()}') + - name: Checkout source + uses: actions/checkout@v2 + - name: Fetch all history for all tags and branches + run: git fetch --prune --unshallow + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.2 + with: + versionSpec: '5.2.x' + - name: Run GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.2 + - name: Put in version and checksum + shell: bash + run: | + sed -i "s/AssemblySemFileVer/${{ steps.gitversion.outputs.AssemblySemFileVer }}/" buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 + sed -i "s/CHECKSUM/${{ steps.checksum.outputs.checksum }}/" buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 + cat buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 diff --git a/.gitignore b/.gitignore index ba242f57346..7f15e6d940b 100644 --- a/.gitignore +++ b/.gitignore @@ -471,3 +471,4 @@ lib/ojdbc.jar # do not ignore JabRef icons (they are ignored by the macos setting above) !src/main/java/org/jabref/gui/icon +*.nupkg diff --git a/GitVersion.yml b/GitVersion.yml index 1c382d48a27..eb4558f46e4 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,4 +1,5 @@ -assembly-versioning-format: '{major}.{minor}.{WeightedPreReleaseNumber}' +assembly-versioning-format: '{major}.{minor}.{WeightedPreReleaseNumber ?? 0}' +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}' assembly-informational-format: '{major}.{minor}{PreReleaseTagWithDash}--{CommitDate}--{ShortSha}' mode: ContinuousDeployment diff --git a/buildres/chocolatey/jabref-dev/jabref-dev.nuspec b/buildres/chocolatey/jabref-dev/jabref-dev.nuspec new file mode 100644 index 00000000000..cfe6012840c --- /dev/null +++ b/buildres/chocolatey/jabref-dev/jabref-dev.nuspec @@ -0,0 +1,38 @@ + + + + + jabref-nightly + + + + AssemblySemFileVer + + JabRef + + + JabRef (development version) + JabRef Developers + https://www.jabref.org/ + https://cdn.jsdelivr.net/gh/JabRef/jabref/src/main/resources/images/external/JabRef-icon-128.png + JabRef + https://github.com/JabRef/jabref/blob/master/LICENSE + true + https://github.com/JabRef/jabref/ + https://docs.jabref.org/ + http://discourse.jabref.org/ + https://github.com/JabRef/jabref/issues + jabref bibtex biblatex latex bibliography reference database + JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. + + https://github.com/JabRef/jabref/blob/master/CHANGELOG.md + + + + + diff --git a/buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 b/buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 new file mode 100644 index 00000000000..903270a39b1 --- /dev/null +++ b/buildres/chocolatey/jabref-dev/tools/chocolateyinstall.ps1 @@ -0,0 +1,29 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" + +$url = 'https://builds.jabref.org/nightly/JabRef-5.1.msi' + +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + unzipLocation = $toolsDir + fileType = 'MSI' + url = $url + url64bit = $url + + softwareName = 'JabRef*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique + + # Checksums are now required as of 0.10.0. + # To determine checksums, you can get that from the original site if provided. + # You can also use checksum.exe (choco install checksum) and use it + # e.g. checksum -t sha256 -f path\to\file + checksum = 'CHECKSUM' + checksumType = 'sha256' #default is md5, can also be sha1, sha256 or sha512 + checksum64 = 'CHECKSUM' + checksumType64= 'sha256' #default is checksumType + + # MSI + silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`"" # ALLUSERS=1 DISABLEDESKTOPSHORTCUT=1 ADDDESKTOPICON=0 ADDSTARTMENU=0 + validExitCodes= @(0, 3010, 1641) +} + +Install-ChocolateyPackage @packageArgs diff --git a/docs/adr/0009-offer-jabref-nightly-as-chocolatey-package.md b/docs/adr/0009-offer-jabref-nightly-as-chocolatey-package.md new file mode 100644 index 00000000000..60498a7f2f2 --- /dev/null +++ b/docs/adr/0009-offer-jabref-nightly-as-chocolatey-package.md @@ -0,0 +1,20 @@ +# Offer jabref-nightly as chocolatey pacakge + +## Context and Problem Statement + +[@OlafHaag](https://github.com/OlafHaag) maintains the [JabRef chocolatey package](https://chocolatey.org/packages/JabRef). +It offers the stable version and the beta versions as "pre releases". + +JabRef builds on each push into `master` an new version, which gets published at . +This offers the possibility for users to test the current development snapshots. +Having the chocolatey mechansim also for development snapshots in place, enables users to automatically update the development snapshots. + +## Considered Options + +* Offer `jabref-nightly` as chocolatey package +* Use `--prerelease` of the `jabref` package as channel for nightly builds + +## Decision Outcome + +Chosen option: "Offer `jabref-nightly` as chocolatey package", because we want to distingish between development versions, beta versions, and releases. Thus, we need three different distributions. When using the chocolatey eco system, there are two different flavours possible for each package. +This is also in line with [vlc-nightly](https://chocolatey.org/packages/vlc-nightly) chocolatey package.