From 1fe6cedf330861cc6c25ad1c7efc99c0ea8705a9 Mon Sep 17 00:00:00 2001 From: Lorenzo Setale Date: Tue, 18 Sep 2018 18:41:07 +0200 Subject: [PATCH 1/2] adds snap package --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 6f8353d..6e3ba11 100644 --- a/package.json +++ b/package.json @@ -106,8 +106,7 @@ "target": [ "deb", "rpm", - "pacman", - "apk" + "snap" ] }, "mac": { From 00ae5a7dfa8f342f74ef10af42e1f6b346ba7d49 Mon Sep 17 00:00:00 2001 From: Lorenzo Setale Date: Tue, 18 Sep 2018 19:41:39 +0200 Subject: [PATCH 2/2] uses a different image and ensures that we are publishing to snapcraft --- .gitlab-ci.yml | 15 +++++++-------- Makefile | 13 ++++++++++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 318eac2..9bce23d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: registry.gitlab.com/siderus/toolchain +image: electronuserland/builder:wine services: - docker:dind @@ -18,14 +18,14 @@ stages: yarn:test: stage: test script: - - docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make lint test" + - make lint test yarn:build:mac: stage: pre-release retry: 2 script: - - docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make build -e OS=Darwin -e UNAME_S=Darwin" + - make build -e OS=Darwin -e UNAME_S=Darwin artifacts: paths: - build @@ -37,7 +37,7 @@ yarn:build:win: stage: pre-release retry: 2 script: - - docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make build -e OS=Windows_NT" + - make build -e OS=Windows_NT artifacts: paths: - build @@ -49,7 +49,7 @@ yarn:build:gnu: stage: pre-release retry: 2 script: - - docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make build -e OS=Linux -e UNAME_S=Linux" + - make build -e OS=Linux -e UNAME_S=Linux artifacts: paths: - build @@ -62,8 +62,7 @@ yarn:release:master: stage: release retry: 2 script: - - make prepare_release - - docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release_all" + - make prepare_release release_all snap_publish cache: {} # Disable cache artifacts: paths: @@ -78,4 +77,4 @@ trigger_upload: script: - curl -X POST -F token=${TRIGGER_REPO_TOKEN} -F ref=master https://gitlab.com/api/v4/projects/7744513/trigger/pipeline only: - - tags + - tags \ No newline at end of file diff --git a/Makefile b/Makefile index c4f1f91..fa01ba6 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,10 @@ REPO_MIGRATIONS_VERSION := $(shell node -p "require('./package.json').ipfsRepoMi REPO_MIGRATIONS_BINARY_NAME ?= fs-repo-migrations_${REPO_MIGRATIONS_VERSION}_${TARGET}-amd64${BINARY_EXT} REPO_MIGRATIONS_BINARY_URL ?= https://dist.ipfs.io/fs-repo-migrations/${REPO_MIGRATIONS_VERSION}/${REPO_MIGRATIONS_BINARY_NAME} NODE_ENV ?= development +TMP_DIR := $(shell mktemp -d) + GH_TOKEN ?= +SNAPCRAFT_TOKEN ?= ifeq ($(OS),Windows_NT) BINARY_EXT := .zip @@ -125,7 +128,7 @@ build_all: clean $(MAKE) build -e OS="Windows_NT" .PHONY: build_all -release: _test_variables prepare_binaries _prepkg +release: _test_variables prepare_release prepare_binaries _prepkg ./node_modules/.bin/build ${BUILD_ARGS} --publish always .PHONY: release @@ -134,3 +137,11 @@ release_all: clean $(MAKE) release -e OS="Linux" -e UNAME_S="Linux" $(MAKE) release -e OS="Windows_NT" .PHONY: release_all + +# Snapcraft publishing +snap_publish: + @echo "$${SNAPCRAFT_TOKEN}" >> ${TMP_DIR}/snap.txt + snapcraft login --with ${TMP_DIR}/snap.txt + snapcraft push --release=stable ./build/Orion_*.snap + rm ${TMP_DIR}/snap.txt +.PHONEY: snap_publish \ No newline at end of file