Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
/ Orion Public archive

Commit

Permalink
Merge pull request #184 from Siderus/feature/enable-builds-gitlab-on-…
Browse files Browse the repository at this point in the history
…release

Enable Gitlab builds for get.siderus.io
  • Loading branch information
koalalorenzo authored Aug 26, 2018
2 parents 1254b1f + 3592e02 commit 6831972
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 64 deletions.
53 changes: 12 additions & 41 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,22 @@ image: registry.gitlab.com/siderus/toolchain
services:
- docker:dind

cache:
# Enables cache on Node Modules on the same branch
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/

stages:
- test
- pre-release
- release
- post-release

before_script:
- mv package.json package.json.old
- cat package.json.old | jq 'to_entries | map(if .key == "env" then .value = "release" else . end) | from_entries' > package.json
- rm -f package.json.old
- mv package.json package.json.old
- cat package.json.old | jq 'to_entries | map(if .key == "statsToken" then .value = "bcd802fa2e699f85cc19e1ff6079e3c7" else . end) | from_entries' > package.json
- rm -f package.json.old


yarn:test:
stage: test
script:
- docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make lint test"
only:
- master
- /release.*/
- tags


yarn:build:mac:
Expand Down Expand Up @@ -65,44 +58,22 @@ yarn:build:gnu:
- /release.*/


yarn:release:mac:
yarn:release:master:
stage: release
retry: 2
script:
- docker run --rm -e GH_TOKEN="${GH_TOKEN}" -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release -e OS=Darwin -e UNAME_S=Darwin"
- make prepare_release
- docker run --rm -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release_all"
cache: {} # Disable cache
artifacts:
paths:
- build
expire_in: 3 months
only:
- tags

yarn:release:win:
stage: release
retry: 2
script:
- docker run --rm -e GH_TOKEN="${GH_TOKEN}" -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release -e OS=Windows_NT"
artifacts:
paths:
- build
expire_in: 3 months
only:
- tags

yarn:release:gnu:
stage: release
retry: 2
script:
- docker run --rm -e GH_TOKEN="${GH_TOKEN}" -v ${PWD}:/project electronuserland/builder:wine /bin/bash -c "make release -e OS=Linux -e UNAME_S=Linux"
artifacts:
paths:
- build
expire_in: 3 months
only:
- tags
- master


trigger_repository:
trigger_upload:
stage: post-release
script:
- curl -X POST -F token=${TRIGGER_REPO_TOKEN} -F ref=master https://gitlab.com/api/v4/projects/7744513/trigger/pipeline
Expand Down
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ _prepkg: dep _test_variables
NODE_ENV=${NODE_ENV} ./node_modules/.bin/electron-compile app
.PHONY: _prepkg

# This endpoints updatse package.json in order to make them realease ready!
prepare_release:
cat package.json | sed "s/-master\",$$/\",/g" >> package.new.json
mv package.new.json package.json
cat package.json | sed "s/\"development\",$$/\"release\",/g" >> package.new.json
mv package.new.json package.json
cat package.json | sed "s/\"9d407c14d888a212cf04c397a95acb7b\",$$/\"bcd802fa2e699f85cc19e1ff6079e3c7\",/g" >> package.new.json
mv package.new.json package.json
.PHONY: prepare_release_values

prepare_binaries: prepare_ipfs_bin prepare_repo_migrations_bin
.PHONY: prepare_binaries

Expand Down Expand Up @@ -116,12 +126,10 @@ build_all: clean
.PHONY: build_all

release: _test_variables prepare_binaries _prepkg
@test -n "$(GH_TOKEN)" || (echo "Variable GH_TOKEN not set"; exit 1)
./node_modules/.bin/build ${BUILD_ARGS} --publish onTagOrDraft
./node_modules/.bin/build ${BUILD_ARGS} --publish always
.PHONY: release

release_all: clean
@test -n "$(GH_TOKEN)" || (echo "Variable GH_TOKEN not set"; exit 1)
$(MAKE) release -e OS="Darwin" -e UNAME_S="Darwin"
$(MAKE) release -e OS="Linux" -e UNAME_S="Linux"
$(MAKE) release -e OS="Windows_NT"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Orion",
"version": "0.8.0",
"version": "0.8.0-master",
"env": "development",
"ipfsVersion": "v0.4.17",
"ipfsRepoMigrationsVersion": "v1.4.0",
Expand Down

0 comments on commit 6831972

Please sign in to comment.