From 98aa0ad05f94d2ec8d9586dadde13a33f012c757 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Tue, 1 Oct 2019 08:37:39 +0200 Subject: [PATCH 01/29] Build snap from java package --- snap/plugins/x_gradle.py | 301 --------------------------------------- snap/snapcraft.yaml | 51 ++----- 2 files changed, 10 insertions(+), 342 deletions(-) delete mode 100644 snap/plugins/x_gradle.py diff --git a/snap/plugins/x_gradle.py b/snap/plugins/x_gradle.py deleted file mode 100644 index 899d6567712..00000000000 --- a/snap/plugins/x_gradle.py +++ /dev/null @@ -1,301 +0,0 @@ -# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- -# -# Copyright (C) 2016, 2018 Canonical Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -"""This plugin is useful for building parts that use gradle. - -The gradle build system is commonly used to build Java projects. -The plugin requires a pom.xml in the root of the source tree. - -This plugin uses the common plugin keywords as well as those for "sources". -For more information check the 'plugins' topic for the former and the -'sources' topic for the latter. - -Additionally, this plugin uses the following plugin-specific keywords: - - - gradle-options: - (list of strings) - Flags to pass to the build using the gradle semantics for parameters. - The 'jar' option is always passed in as the last parameter. - - - gradle-output-dir: - (string; default: 'build/libs') - The output directory where the resulting jar or war files from gradle[w] - are generated. - - - gradle-version: - (string) - The version of gradle you want to use to build the source artifacts. - Defaults to the current release downloadable from - https://services.gradle.org/distributions/ - The entry is ignored if gradlew is found. - - - gradle-version-checksum: - (string) - The checksum for gradle-version in the form of /. - As an example "sha512/2a803f578f341e164f6753e410413d16ab60fab...". - - - gradle-openjdk-version: - (string) - openjdk version available to the base to use. If not set the latest - version available to the base will be used. -""" - -import logging -import os -import urllib.parse -from glob import glob -from typing import Sequence - -import snapcraft -from snapcraft import file_utils, formatting_utils -from snapcraft.internal import errors, sources - -logger = logging.getLogger(__name__) - - -_DEFAULT_GRADLE_VERSION = "4.10.2" -_DEFAULT_GRADLE_CHECKSUM = ( - "sha256/b49c6da1b2cb67a0caf6c7480630b51c70a11ca2016ff2f555eaeda863143a29" -) -_GRADLE_URL = "https://services.gradle.org/distributions/gradle-{version}-bin.zip" - - -class UnsupportedJDKVersionError(errors.SnapcraftError): - - fmt = ( - "The gradle-openjdk-version plugin property was set to {version!r}.\n" - "Valid values for the {base!r} base are: {valid_versions}." - ) - - def __init__( - self, *, base: str, version: str, valid_versions: Sequence[str] - ) -> None: - super().__init__( - base=base, - version=version, - valid_versions=formatting_utils.humanize_list( - valid_versions, conjunction="or" - ), - ) - - -class GradlePlugin(snapcraft.BasePlugin): - @classmethod - def schema(cls): - schema = super().schema() - schema["properties"]["gradle-options"] = { - "type": "array", - "minitems": 1, - "uniqueItems": True, - "items": {"type": "string"}, - "default": [], - } - schema["properties"]["gradle-output-dir"] = { - "type": "string", - "default": "build/libs", - } - - schema["properties"]["gradle-version"] = {"type": "string"} - - schema["properties"]["gradle-version-checksum"] = {"type": "string"} - - schema["properties"]["gradle-openjdk-version"] = { - "type": "string", - "default": "", - } - - schema["required"] = ["source"] - - return schema - - @classmethod - def get_pull_properties(cls): - # Inform Snapcraft of the properties associated with pulling. If these - # change in the YAML Snapcraft will consider the pull step dirty. - return ["gradle-version", "gradle-version-checksum", "gradle-openjdk-version"] - - @classmethod - def get_build_properties(cls): - # Inform Snapcraft of the properties associated with building. If these - # change in the YAML Snapcraft will consider the build step dirty. - return super().get_build_properties() + ["gradle-options", "gradle-output-dir"] - - @property - def _gradle_tar(self): - if self._gradle_tar_handle is None: - gradle_uri = _GRADLE_URL.format(version=self._gradle_version) - self._gradle_tar_handle = sources.Zip( - gradle_uri, self._gradle_dir, source_checksum=self._gradle_checksum - ) - return self._gradle_tar_handle - - def __init__(self, name, options, project): - super().__init__(name, options, project) - - self._setup_gradle() - self._setup_base_tools(project.info.get_build_base()) - - def _setup_base_tools(self, base): - if base not in ("core", "core16", "core18"): - raise errors.PluginBaseError( - part_name=self.name, base=self.project.info.get_build_base() - ) - - if base in ("core", "core16"): - valid_versions = ["8", "9"] - elif base == "core18": - valid_versions = ["8", "11"] - - version = self.options.gradle_openjdk_version - if not version: - version = valid_versions[-1] - elif version not in valid_versions: - raise UnsupportedJDKVersionError( - version=version, base=base, valid_versions=valid_versions - ) - - self.stage_packages.append("openjdk-{}-jre-headless".format(version)) - self.build_packages.append("openjdk-{}-jdk-headless".format(version)) - self.build_packages.append("ca-certificates-java") - self._java_version = version - - def _using_gradlew(self) -> bool: - return os.path.isfile(os.path.join(self.sourcedir, "gradlew")) - - def _setup_gradle(self): - self._gradle_tar_handle = None - self._gradle_dir = os.path.join(self.partdir, "gradle") - if self.options.gradle_version: - self._gradle_version = self.options.gradle_version - self._gradle_checksum = self.options.gradle_version_checksum - else: - self._gradle_version = _DEFAULT_GRADLE_VERSION - self._gradle_checksum = _DEFAULT_GRADLE_CHECKSUM - - def pull(self): - super().pull() - - if self._using_gradlew(): - logger.info("Found gradlew, skipping gradle setup.") - return - - os.makedirs(self._gradle_dir, exist_ok=True) - self._gradle_tar.download() - - def build(self): - super().build() - - if self._using_gradlew(): - gradle_cmd = ["./gradlew"] - else: - self._gradle_tar.provision(self._gradle_dir, keep_zip=True) - gradle_cmd = ["gradle"] - self.run( - gradle_cmd - + self._get_proxy_options() - + self.options.gradle_options, - rootdir=self.builddir, - ) - - src = os.path.join(self.builddir, self.options.gradle_output_dir) - basedir = "jabref" - # jarfiles = glob(os.path.join(src, "*.jar")) - # warfiles = glob(os.path.join(src, "*.war")) - - # if len(jarfiles) > 0: - # basedir = "jar" - # elif len(warfiles) > 0: - # basedir = "war" - # jarfiles = warfiles - # else: - # raise RuntimeError("Could not find any built jar files for part") - - file_utils.link_or_copy_tree( - src, - os.path.join(self.installdir, basedir), - copy_function=lambda src, dst: file_utils.link_or_copy( - src, dst, self.installdir - ), - ) - - self._create_symlinks() - - def _create_symlinks(self): - if self.project.info.get_build_base() not in ("core18", "core16", "core"): - raise errors.PluginBaseError( - part_name=self.name, base=self.project.info.get_build_base() - ) - - os.makedirs(os.path.join(self.installdir, "bin"), exist_ok=True) - java_bin = glob( - os.path.join( - self.installdir, - "usr", - "lib", - "jvm", - "java-{}-openjdk-*".format(self._java_version), - "bin", - "java", - ) - )[0] - os.symlink( - os.path.relpath(java_bin, os.path.join(self.installdir, "bin")), - os.path.join(self.installdir, "bin", "java"), - ) - - def run(self, cmd, rootdir): - super().run(cmd, cwd=rootdir, env=self._build_environment()) - - def _build_environment(self): - if self._using_gradlew(): - return - - env = os.environ.copy() - gradle_bin = os.path.join( - self._gradle_dir, "gradle-{}".format(self._gradle_version), "bin" - ) - print(gradle_bin) - - if env.get("PATH"): - new_path = "{}:{}".format(gradle_bin, env.get("PATH")) - else: - new_path = gradle_bin - - env["PATH"] = new_path - return env - - def _get_proxy_options(self): - proxy_options = [] - for var in ("http", "https"): - proxy = os.environ.get("{}_proxy".format(var), False) - if proxy: - parsed_url = urllib.parse.urlparse(proxy) - proxy_options.append( - "-D{}.proxyHost={}".format(var, parsed_url.hostname) - ) - if parsed_url.port: - proxy_options.append( - "-D{}.proxyPort={}".format(var, parsed_url.port) - ) - if parsed_url.username: - proxy_options.append( - "-D{}.proxyUser={}".format(var, parsed_url.username) - ) - if parsed_url.password: - proxy_options.append( - "-D{}.proxyPassword={}".format(var, parsed_url.password) - ) - return proxy_options diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b62d2d571e3..f3d5b84ec64 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,7 +1,7 @@ name: jabref -version: "git" -version-script: cat build.gradle | grep "^version =" | cut -d'"' -f2 -#icon: snap/gui/jabref.png +adopt-info: jabref +icon: snap/gui/jabref.png +license: MIT summary: Bibliography manager description: JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. @@ -14,11 +14,10 @@ architectures: apps: jabref: - command: desktop-launch $SNAP/jabref/bin/JabRefMain + command: bin/JabRef + extensions: [gnome-3-28] environment: _JAVA_OPTIONS: "-Duser.home=$SNAP_USER_DATA" - XDG_DATA_DIRS: $SNAP/share:$XDG_DATA_DIRS - GSETTINGS_SCHEMA_DIR: $SNAP/share/glib-2.0/schemas plugs: - desktop - desktop-legacy @@ -28,43 +27,13 @@ apps: - opengl - network-bind - removable-media - - gnome-3-28-1804 - -plugs: - gnome-3-28-1804: - interface: content - target: gnome-platform - default-provider: gnome-3-28-1804:gnome-3-28-1804 - content: gnome-3-28-1804 - gtk-3-themes: - interface: content - target: $SNAP/data-dir/themes - default-provider: gtk-common-themes:gtk-3-themes - icon-themes: - interface: content - target: $SNAP/data-dir/icons - default-provider: gtk-common-themes:icon-themes - parts: jabref: - plugin: x_gradle - source: . - source-type: git + plugin: dump + source: http://builds.jabref.org/master/JabRef-portable_linux.tar.gz + override-pull: | + snapcraftctl pull + snapcraftctl set-version "$(cat app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" stage-packages: - - openjdk-11-jre - - openjfx - x11-utils - gradle-options: [jlink, -xtest] - gradle-output-dir: 'build/image' - desktop-gnome-platform: - source: https://github.com/ubuntu/snapcraft-desktop-helpers.git - source-subdir: gtk - plugin: make - make-parameters: ["FLAVOR=gtk3"] - build-packages: - - build-essential - - libgtk-3-dev - override-build: | - snapcraftctl build - mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform From 9f0da252121c7828ddac3b3ff77ae14acda4a89d Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 13:05:23 +0200 Subject: [PATCH 02/29] add snap to github ci --- .github/workflows/deployment.yml | 139 +++++++++++++++++-------------- 1 file changed, 78 insertions(+), 61 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 301e478b605..04b82a22eef 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -3,30 +3,30 @@ name: Deployment on: [push] jobs: - deploy: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - include: - - os: ubuntu-latest - displayName: linux - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - - os: windows-latest - displayName: windows - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip - jdk14Path: /jdk-14 - archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef - - os: macOS-latest - displayName: macOS - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 + # deploy: + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest, macOS-latest] + # include: + # - os: ubuntu-latest + # displayName: linux + # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 + # - os: windows-latest + # displayName: windows + # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip + # jdk14Path: /jdk-14 + # archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef + # - os: macOS-latest + # displayName: macOS + # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - runs-on: ${{ matrix.os }} - name: Deploy on ${{ matrix.displayName }} + # runs-on: ${{ matrix.os }} + # name: Deploy on ${{ matrix.displayName }} steps: - name: Checkout source @@ -48,42 +48,59 @@ jobs: 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 -Pdev=true jlinkZip - - name: Build installer + # 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 -Pdev=true jlinkZip + # - name: Build installer + # run: | + # export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" + # ./gradlew -Pdev=true jpackage + # shell: bash + # - name: Add installer as artifact + # uses: actions/upload-artifact@master + # with: + # name: JabRef-${{ matrix.displayName }} + # path: build/distribution + # - name: Package application image + # run: ${{ matrix.archivePortable }} + # shell: bash + # - name: Extract branch name + # shell: bash + # run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + # id: extract_branch + # - name: Upload to builds.jabref.org + # uses: garygrossgarten/github-action-scp@release + # with: + # local: build/distribution + # remote: www/${{ steps.extract_branch.outputs.branch }} + # host: builds.jabref.org + # username: builds_jabref_org + # privateKey: ${{ secrets.buildJabRefPrivateKey }} + # port: 9922 + build-snap: + runs-on: ubuntu-latest + container: + image: snapcore/snapcraft + steps: + - uses: actions/checkout@v1 + - name: Build snap run: | - export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" - ./gradlew -Pdev=true jpackage - shell: bash - - name: Add installer as artifact - uses: actions/upload-artifact@master - with: - name: JabRef-${{ matrix.displayName }} - path: build/distribution - - name: Package application image - run: ${{ matrix.archivePortable }} - shell: bash - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Upload to builds.jabref.org - uses: garygrossgarten/github-action-scp@release - with: - local: build/distribution - remote: www/${{ steps.extract_branch.outputs.branch }} - host: builds.jabref.org - username: builds_jabref_org - privateKey: ${{ secrets.buildJabRefPrivateKey }} - port: 9922 + snapcraft + # - name: Push snap + # env: + # SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} + # run: | + # cd stable + # mkdir .snapcraft + # echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + # snapcraft push --release=stable *.snap \ No newline at end of file From f500da2ed19cb2925e0667616045901674712e95 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 13:25:35 +0200 Subject: [PATCH 03/29] Use docker snapcraft --- .github/workflows/deployment.yml | 114 ++++++++++++++++--------------- 1 file changed, 60 insertions(+), 54 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 04b82a22eef..639a8f8789b 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -3,30 +3,30 @@ name: Deployment on: [push] jobs: - # deploy: - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, windows-latest, macOS-latest] - # include: - # - os: ubuntu-latest - # displayName: linux - # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - # - os: windows-latest - # displayName: windows - # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip - # jdk14Path: /jdk-14 - # archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef - # - os: macOS-latest - # displayName: macOS - # jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 + deploy: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + include: + - os: ubuntu-latest + displayName: linux + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 + - os: windows-latest + displayName: windows + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip + jdk14Path: /jdk-14 + archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip build/distribution/JabRef/ && rm -R build/distribution/JabRef + - os: macOS-latest + displayName: macOS + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - # runs-on: ${{ matrix.os }} - # name: Deploy on ${{ matrix.displayName }} + runs-on: ${{ matrix.os }} + name: Deploy on ${{ matrix.displayName }} steps: - name: Checkout source @@ -48,36 +48,36 @@ jobs: 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 -Pdev=true jlinkZip - # - name: Build installer - # run: | - # export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" - # ./gradlew -Pdev=true jpackage - # shell: bash - # - name: Add installer as artifact - # uses: actions/upload-artifact@master - # with: - # name: JabRef-${{ matrix.displayName }} - # path: build/distribution - # - name: Package application image - # run: ${{ matrix.archivePortable }} - # shell: bash - # - name: Extract branch name - # shell: bash - # run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - # id: extract_branch + 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 -Pdev=true jlinkZip + - name: Build installer + run: | + export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}" + ./gradlew -Pdev=true jpackage + shell: bash + - name: Add installer as artifact + uses: actions/upload-artifact@master + with: + name: JabRef-${{ matrix.displayName }} + path: build/distribution + - name: Package application image + run: ${{ matrix.archivePortable }} + shell: bash + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch # - name: Upload to builds.jabref.org # uses: garygrossgarten/github-action-scp@release # with: @@ -87,6 +87,12 @@ jobs: # username: builds_jabref_org # privateKey: ${{ secrets.buildJabRefPrivateKey }} # port: 9922 + # - name: build-snap + # runs-on: ubuntu-latest + # container: + # image: snapcore/snapcraft + # run: | + # docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" build-snap: runs-on: ubuntu-latest container: @@ -95,7 +101,7 @@ jobs: - uses: actions/checkout@v1 - name: Build snap run: | - snapcraft + docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" # - name: Push snap # env: # SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} From c8f7e1bd6aabc400c784e8d47f0d809f5fba2f18 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 13:30:34 +0200 Subject: [PATCH 04/29] Add container to ubuntu matrix item --- .github/workflows/deployment.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 639a8f8789b..08f7fe54978 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,6 +10,8 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] include: - os: ubuntu-latest + container: + image: snapcore/snapcraft displayName: linux jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_linux-x64_bin.tar.gz jdk14Path: /jdk-14 @@ -87,21 +89,22 @@ jobs: # username: builds_jabref_org # privateKey: ${{ secrets.buildJabRefPrivateKey }} # port: 9922 - # - name: build-snap - # runs-on: ubuntu-latest - # container: - # image: snapcore/snapcraft - # run: | - # docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" - build-snap: - runs-on: ubuntu-latest - container: - image: snapcore/snapcraft - steps: - - uses: actions/checkout@v1 - - name: Build snap + - name: build-snap + # runs-on: ubuntu-latest + # container: + # image: snapcore/snapcraft run: | - docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" + if (url.endswith("tar.gz")): + docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" + # build-snap: + # runs-on: ubuntu-latest + # container: + # image: snapcore/snapcraft + # steps: + # - uses: actions/checkout@v1 + # - name: Build snap + # run: | + # docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" # - name: Push snap # env: # SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} From 6dfe4773a8d91e48e995de3251d8b1c4de81f649 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 13:44:11 +0200 Subject: [PATCH 05/29] move snap workflow to matrix --- .github/workflows/deployment.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 08f7fe54978..bc4770c53b8 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -16,6 +16,7 @@ jobs: jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 + snapBuild: docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip @@ -76,6 +77,9 @@ jobs: - name: Package application image run: ${{ matrix.archivePortable }} shell: bash + - name: Package Linux snap + run: $({snapBuild}) + shell: bash - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" @@ -89,13 +93,7 @@ jobs: # username: builds_jabref_org # privateKey: ${{ secrets.buildJabRefPrivateKey }} # port: 9922 - - name: build-snap - # runs-on: ubuntu-latest - # container: - # image: snapcore/snapcraft - run: | - if (url.endswith("tar.gz")): - docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" + # build-snap: # runs-on: ubuntu-latest # container: From 2af172180d46f8e82c088a84e7bc4f22c41013ba Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 13:56:43 +0200 Subject: [PATCH 06/29] add matrix to snapbuild --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index bc4770c53b8..2780abbcab5 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -78,7 +78,7 @@ jobs: run: ${{ matrix.archivePortable }} shell: bash - name: Package Linux snap - run: $({snapBuild}) + run: $({ matrix.snapBuild }) shell: bash - name: Extract branch name shell: bash From 90439f702bdc31e49baa554ca3ea99556e44addb Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 14:17:40 +0200 Subject: [PATCH 07/29] add transfer.sh link --- .github/workflows/deployment.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2780abbcab5..f6555900972 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -78,8 +78,11 @@ jobs: run: ${{ matrix.archivePortable }} shell: bash - name: Package Linux snap - run: $({ matrix.snapBuild }) + run: ${{ matrix.snapBuild }} shell: bash + - name: Upload snap + run: curl --upload-file ./*.snap https://transfer.sh/jabref_master.snap + shell: bash - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" From 208539c4c4b1d8bf02b48ebc899c8cfd5a252090 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 14:28:01 +0200 Subject: [PATCH 08/29] Use tar from build/distribution --- .github/workflows/deployment.yml | 4 ++-- snap/snapcraft.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f6555900972..2e7da1ddfc2 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -16,7 +16,7 @@ jobs: jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - snapBuild: docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" + snapBuild: docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip @@ -81,7 +81,7 @@ jobs: run: ${{ matrix.snapBuild }} shell: bash - name: Upload snap - run: curl --upload-file ./*.snap https://transfer.sh/jabref_master.snap + run: curl --upload-file build/distribution/*.snap https://transfer.sh/jabref_master.snap shell: bash - name: Extract branch name shell: bash diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f3d5b84ec64..0b3202e7c8a 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -31,7 +31,7 @@ apps: parts: jabref: plugin: dump - source: http://builds.jabref.org/master/JabRef-portable_linux.tar.gz + source: build/distribution/JabRef-portable_linux.tar.gz override-pull: | snapcraftctl pull snapcraftctl set-version "$(cat app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" From 8ad81258b47771d86fb9e0efafedb1166a798a02 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 14:34:32 +0200 Subject: [PATCH 09/29] Add stable snapcraft --- .github/workflows/deployment.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2e7da1ddfc2..f445556891c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,12 +11,12 @@ jobs: include: - os: ubuntu-latest container: - image: snapcore/snapcraft + image: snapcore/snapcraft:stable displayName: linux jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - snapBuild: docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + snapBuild: docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip @@ -96,21 +96,3 @@ jobs: # username: builds_jabref_org # privateKey: ${{ secrets.buildJabRefPrivateKey }} # port: 9922 - - # build-snap: - # runs-on: ubuntu-latest - # container: - # image: snapcore/snapcraft - # steps: - # - uses: actions/checkout@v1 - # - name: Build snap - # run: | - # docker run -v $(pwd):$(pwd) -t snapcore:snapcraft sh -c "apt update -qq && cd $(pwd) && snapcraft" - # - name: Push snap - # env: - # SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} - # run: | - # cd stable - # mkdir .snapcraft - # echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg - # snapcraft push --release=stable *.snap \ No newline at end of file From 7deadac5ff669e10fb4c8483c4e235a2b7a1fb08 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 14:43:27 +0200 Subject: [PATCH 10/29] Remove explicit container --- .github/workflows/deployment.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f445556891c..95eca0aeafa 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -10,8 +10,6 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] include: - os: ubuntu-latest - container: - image: snapcore/snapcraft:stable displayName: linux jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_linux-x64_bin.tar.gz jdk14Path: /jdk-14 From 1fd8738af7d784b13f4a7c32a213143ad62865b2 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Wed, 2 Oct 2019 15:18:34 +0200 Subject: [PATCH 11/29] Attempt at a github actions integration --- .github/workflows/deployment.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 95eca0aeafa..2e72caa3b4a 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -15,6 +15,7 @@ jobs: jdk14Path: /jdk-14 archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef snapBuild: docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + snapPushBeta: cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip @@ -73,14 +74,15 @@ jobs: name: JabRef-${{ matrix.displayName }} path: build/distribution - name: Package application image - run: ${{ matrix.archivePortable }} - shell: bash - - name: Package Linux snap - run: ${{ matrix.snapBuild }} + env: + SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} + run: | + ${{ matrix.archivePortable }} + if [ ${{matrix.os}} == "ubuntu-latest" ] then + ${{ matrix.snapBuild }} + # ${{ matrix.snapPushBeta }} + fi shell: bash - - name: Upload snap - run: curl --upload-file build/distribution/*.snap https://transfer.sh/jabref_master.snap - shell: bash - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" From 8eb36dcb57c115ce0c77f402283b4f5ca5bf7a91 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 2 Oct 2019 17:42:52 +0200 Subject: [PATCH 12/29] Try to make it work... --- .github/workflows/deployment.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2e72caa3b4a..9b4294d6926 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,6 +1,6 @@ name: Deployment -on: [push] +on: [pull_request, push] jobs: deploy: @@ -14,8 +14,6 @@ jobs: jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_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 - snapBuild: docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" - snapPushBeta: cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap - os: windows-latest displayName: windows jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-35_windows-x64_bin.zip @@ -74,19 +72,19 @@ jobs: name: JabRef-${{ matrix.displayName }} path: build/distribution - name: Package application image - env: - SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} - run: | - ${{ matrix.archivePortable }} - if [ ${{matrix.os}} == "ubuntu-latest" ] then - ${{ matrix.snapBuild }} - # ${{ matrix.snapPushBeta }} - fi + run: ${{ matrix.archivePortable }} shell: bash - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch + - name: Build and publish snap + if: matrix.os == "ubuntu-latest" + env: + SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} + run: | + docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap # - name: Upload to builds.jabref.org # uses: garygrossgarten/github-action-scp@release # with: From 45e25c3273bc421fa222d8cb93ffbeac14c6855a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Wed, 2 Oct 2019 17:46:20 +0200 Subject: [PATCH 13/29] Try to fix ? --- .github/workflows/deployment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9b4294d6926..65378019d02 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -72,19 +72,20 @@ jobs: name: JabRef-${{ matrix.displayName }} path: build/distribution - name: Package application image - run: ${{ matrix.archivePortable }} + run: ${{ matrix.archivePortable }} shell: bash - name: Extract branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Build and publish snap - if: matrix.os == "ubuntu-latest" + if: matrix.os == 'ubuntu-latest' env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap + shell: bash # - name: Upload to builds.jabref.org # uses: garygrossgarten/github-action-scp@release # with: From 7af1e484c26a02f9aadea35d7dfdb07364fe5d78 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 08:41:11 +0200 Subject: [PATCH 14/29] Build without docker --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2e74d02b47c..49cc5a99f10 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -83,7 +83,7 @@ jobs: env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | - docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:stable sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + snapcraft && mv *.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap shell: bash # - name: Upload to builds.jabref.org From fa2deba86ad7264f912860d2cb92c9d53ed79063 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 08:43:20 +0200 Subject: [PATCH 15/29] Build with latest docker --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 49cc5a99f10..e489b75faff 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -83,7 +83,7 @@ jobs: env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | - snapcraft && mv *.snap build/distribution/" + docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:latest sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap shell: bash # - name: Upload to builds.jabref.org From 49e9b11f9fbd7d3f812cbc43e36dea5a07467023 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 11:36:22 +0200 Subject: [PATCH 16/29] Add docker image based on bionic --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index e489b75faff..c3004cb982e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -83,7 +83,7 @@ jobs: env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | - docker run -v $(pwd):$(pwd) -t snapcore/snapcraft:latest sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap shell: bash # - name: Upload to builds.jabref.org From 93211a44ca01a3651fd782f01ba9a412a4566d7e Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 11:54:50 +0200 Subject: [PATCH 17/29] Temporarily revert to version-script --- snap/snapcraft.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 0b3202e7c8a..a60eadd2d4d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,7 @@ name: jabref -adopt-info: jabref +# adopt-info: jabref +version: 'master' +version-script: cat build.gradle | grep "^version =" | cut -d'"' -f2 icon: snap/gui/jabref.png license: MIT summary: Bibliography manager @@ -32,8 +34,8 @@ parts: jabref: plugin: dump source: build/distribution/JabRef-portable_linux.tar.gz - override-pull: | - snapcraftctl pull - snapcraftctl set-version "$(cat app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" + # override-pull: | + # snapcraftctl pull + # snapcraftctl set-version "$(cat app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" stage-packages: - x11-utils From 37d86b170f1afbfa0c5ceeef51526c9666afe506 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 12:38:07 +0200 Subject: [PATCH 18/29] Uncomment upload to builds.jabref --- .github/workflows/deployment.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index c3004cb982e..b4c6c26d462 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -86,12 +86,12 @@ jobs: docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap shell: bash - # - name: Upload to builds.jabref.org - # uses: garygrossgarten/github-action-scp@release - # with: - # local: build/distribution - # remote: www/${{ steps.extract_branch.outputs.branch }} - # host: builds.jabref.org - # username: builds_jabref_org - # privateKey: ${{ secrets.buildJabRefPrivateKey }} - # port: 9922 + - name: Upload to builds.jabref.org + uses: garygrossgarten/github-action-scp@release + with: + local: build/distribution + remote: www/${{ steps.extract_branch.outputs.branch }} + host: builds.jabref.org + username: builds_jabref_org + privateKey: ${{ secrets.buildJabRefPrivateKey }} + port: 9922 From e274acadf8ecfe0bcbdf7b32da51ecae03821244 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Oct 2019 12:57:44 +0200 Subject: [PATCH 19/29] Make sure to move only jabref snap to build folder --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index b4c6c26d462..350bd04e603 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -83,7 +83,7 @@ jobs: env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | - docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv *.snap build/distribution/" + docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/" # cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap shell: bash - name: Upload to builds.jabref.org From 17b2c30604867a421b60ea502dc23cd577e98212 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 7 Oct 2019 12:12:14 +0200 Subject: [PATCH 20/29] Update and rename deployment.yml to snap-deployment.yml Modify to push again --- .github/workflows/{deployment.yml => snap-deployment.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{deployment.yml => snap-deployment.yml} (98%) diff --git a/.github/workflows/deployment.yml b/.github/workflows/snap-deployment.yml similarity index 98% rename from .github/workflows/deployment.yml rename to .github/workflows/snap-deployment.yml index 350bd04e603..151342c8b42 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/snap-deployment.yml @@ -1,6 +1,6 @@ -name: Deployment +name: Snap-Deployment -on: [pull_request, push] +on: [push] jobs: deploy: From 9ab74db3dd74885b10d320faeed3281bd7a5d739 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 13:07:04 +0200 Subject: [PATCH 21/29] Update and rename snap-deployment.yml to deployment.yml --- .github/workflows/{snap-deployment.yml => deployment.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{snap-deployment.yml => deployment.yml} (99%) diff --git a/.github/workflows/snap-deployment.yml b/.github/workflows/deployment.yml similarity index 99% rename from .github/workflows/snap-deployment.yml rename to .github/workflows/deployment.yml index 151342c8b42..934e1d841f2 100644 --- a/.github/workflows/snap-deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,4 +1,4 @@ -name: Snap-Deployment +name: Deployment on: [push] From 60112f4beac90a090648df840e5d62fa85689663 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 13:08:25 +0200 Subject: [PATCH 22/29] Reenable checks for PRs --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 934e1d841f2..350bd04e603 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,6 +1,6 @@ name: Deployment -on: [push] +on: [pull_request, push] jobs: deploy: From 801dbaf9bde8bf325161c934654606a1149cc480 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 13:09:02 +0200 Subject: [PATCH 23/29] Temporarily disable master branch check to test --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 350bd04e603..203762694c4 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -79,7 +79,7 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Build and publish snap - if: matrix.os == 'ubuntu-latest' + #if: matrix.os == 'ubuntu-latest' env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | From b4a27a5c46308b426ea217c0d098bf0b549cc822 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 13:09:25 +0200 Subject: [PATCH 24/29] I'm tired... --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 203762694c4..350bd04e603 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -79,7 +79,7 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - name: Build and publish snap - #if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: | From abe96f322772dc119a1ebc1e9bf2d4944ab1a70f Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 13:42:51 +0200 Subject: [PATCH 25/29] Fix branch name detection for PRs --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 350bd04e603..ee1dfafadf7 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -76,7 +76,7 @@ jobs: shell: bash - name: Extract branch name shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + run: echo "##[set-output name=branch;]$(echo ${${${GITHUB_REF#refs/heads/}#refs/pull/}%/merge})" id: extract_branch - name: Build and publish snap if: matrix.os == 'ubuntu-latest' From 7d951c035a21ea42b6901f0449e62b0b4bda5e2a Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 14:22:23 +0200 Subject: [PATCH 26/29] Try to fix branch name detection --- .github/workflows/deployment.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index ee1dfafadf7..f68aa95d4be 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -33,6 +33,14 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 + - name: Extract branch name + shell: bash + run: | + ref = ${GITHUB_REF#refs/heads/} + ref = ${ref#refs/pull/} + ref = ${ref%/merge} + echo "##[set-output name=branch;]$(ref)" + id: extract_branch - name: Set up JDK uses: actions/setup-java@v1 with: @@ -74,10 +82,6 @@ jobs: - name: Package application image run: ${{ matrix.archivePortable }} shell: bash - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${${${GITHUB_REF#refs/heads/}#refs/pull/}%/merge})" - id: extract_branch - name: Build and publish snap if: matrix.os == 'ubuntu-latest' env: From c4f3f035b0b4b345aabb0ebdeab1f5b20c20b9fa Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 14:25:43 +0200 Subject: [PATCH 27/29] Update deployment.yml --- .github/workflows/deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 3edc68d4957..d124bc55351 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -37,9 +37,9 @@ jobs: - name: Extract branch name shell: bash run: | - ref = ${GITHUB_REF#refs/heads/} - ref = ${ref#refs/pull/} - ref = ${ref%/merge} + ref=${GITHUB_REF#refs/heads/} + ref=${ref#refs/pull/} + ref=${ref%/merge} echo "##[set-output name=branch;]$(ref)" id: extract_branch - name: Set up JDK From ba959971ecffc03bde3472250a9eb0e2154b1b0c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 14:27:09 +0200 Subject: [PATCH 28/29] Update deployment.yml --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index d124bc55351..add34aec693 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -40,7 +40,7 @@ jobs: ref=${GITHUB_REF#refs/heads/} ref=${ref#refs/pull/} ref=${ref%/merge} - echo "##[set-output name=branch;]$(ref)" + echo "##[set-output name=branch;]${ref}" id: extract_branch - name: Set up JDK uses: actions/setup-java@v1 From c8f1ae3a7e68c2c9cbeb2c425a4956ab8e414e56 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 7 Oct 2019 16:17:30 +0200 Subject: [PATCH 29/29] Remove on PR --- .github/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index add34aec693..49eae5fb82f 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,6 +1,6 @@ name: Deployment -on: [pull_request, push] +on: [push] jobs: deploy: @@ -84,7 +84,7 @@ jobs: run: ${{ matrix.archivePortable }} shell: bash - name: Build and publish snap - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && steps.extract_branch.outputs.branch == 'master' env: SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} run: |