ryzen-controller/.gitlab-ci.yml

277 lines
7.9 KiB
YAML
Raw Normal View History

2019-06-03 23:09:16 +07:00
include:
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
2019-06-03 23:09:16 +07:00
2019-02-28 19:52:24 +07:00
stages:
2019-06-03 23:09:16 +07:00
- test
2019-02-28 19:52:24 +07:00
- install
- build
2019-02-28 19:52:24 +07:00
- installer
- release-note
- release
###############################################################################
## TEST
###############################################################################
2019-06-03 23:09:16 +07:00
# See https://gitlab.com/ryzen-controller-team/ryzen-controller/-/pipelines/156178573
# code_quality:
# stage: test
# only:
# - branches
# - schedules@ryzen-controller-team/ryzen-controller
# except: []
2019-07-05 16:35:30 +07:00
# See https://gitlab.com/ryzen-controller-team/ryzen-controller/-/pipelines/156177371
# dependency_scanning:
# stage: test
# only:
# - branches
# - schedules@ryzen-controller-team/ryzen-controller
# except: []
2019-06-03 23:09:16 +07:00
# See https://gitlab.com/ryzen-controller-team/ryzen-controller/-/pipelines/156178280
# sast:
# stage: test
# only:
# - branches
# - schedules@ryzen-controller-team/ryzen-controller
# except: []
2019-02-28 19:52:24 +07:00
2019-08-04 15:02:03 +07:00
release-check:
tags: [ docker ]
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
only:
- branches
- schedules@ryzen-controller-team/ryzen-controller
stage: test
script:
- release next-version > .next_version
- cat .next_version
2019-08-04 15:02:03 +07:00
artifacts:
paths:
- .next_version
###############################################################################
## INSTALL
###############################################################################
2019-02-28 19:52:24 +07:00
node:
only:
- branches
- schedules@ryzen-controller-team/ryzen-controller
2019-02-28 19:52:24 +07:00
stage: install
tags: [ docker ]
image: storm1er/electron-builder-wine-dubnium:1.0.2
needs:
2019-08-04 15:02:03 +07:00
- release-check
2019-02-28 19:52:24 +07:00
script:
2019-08-04 15:02:03 +07:00
- VERSION=`cat .next_version`
- yarn config set version-git-tag false
- yarn version --new-version "${VERSION}"
- yarn install --frozen-lockfile
2019-02-28 19:52:24 +07:00
cache:
paths:
- node_modules/
artifacts:
paths:
- node_modules/
2019-08-04 15:02:03 +07:00
- package.json
2019-02-28 19:52:24 +07:00
###############################################################################
## BUILD
###############################################################################
build:
2019-02-28 19:52:24 +07:00
only:
- branches
- schedules@ryzen-controller-team/ryzen-controller
stage: build
2019-02-28 19:52:24 +07:00
tags: [ docker ]
image: storm1er/electron-builder-wine-dubnium:1.0.2
2019-02-28 19:52:24 +07:00
script:
- yarn build
2019-03-11 20:40:26 +07:00
artifacts:
paths:
- build/
needs:
2019-02-28 19:52:24 +07:00
- node
###############################################################################
## INSTALLER
###############################################################################
installers:
2019-03-11 20:40:26 +07:00
only:
- branches
- schedules@ryzen-controller-team/ryzen-controller
2019-03-11 20:40:26 +07:00
stage: installer
tags: [ docker ]
image: storm1er/electron-builder-wine-dubnium:1.0.2
2019-03-11 20:40:26 +07:00
script:
- export ELECTRON_CACHE=`pwd`/.cache/electron
- export ELECTRON_BUILDER_CACHE=`pwd`/.cache/builder
- mkdir -p `pwd`/.cache/electron
- mkdir -p `pwd`/.cache/builder
- yarn dist-pack:all
- mkdir dist/win
- mkdir dist/rpm
- mkdir dist/deb
- mv dist/*.exe dist/win/
- mv dist/*.rpm dist/rpm/
- mv dist/*.deb dist/deb/
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/dist/win/" > .exe_link
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/dist/rpm/" > .rpm_link
- echo "https://gitlab.com/ryzen-controller-team/ryzen-controller/-/jobs/${CI_JOB_ID}/artifacts/browse/dist/deb/" > .deb_link
cache:
2019-03-11 20:40:26 +07:00
paths:
- .cache
2019-03-11 20:40:26 +07:00
artifacts:
paths:
- dist/win
- dist/rpm
- dist/deb
- .exe_link
- .rpm_link
- .deb_link
expire_in: never
needs:
2019-03-11 20:40:26 +07:00
- node
- build
###############################################################################
## RELEASE-NOTE
###############################################################################
create-rpm-link:
tags: [ docker ]
image: alpine
stage: release-note
needs:
- installers
- release-check
only:
- schedules@ryzen-controller-team/ryzen-controller
before_script:
- apk add curl jq
script:
- URL=`cat .rpm_link`
- VERSION=`cat .next_version`
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
- curl -H "Content-Type:application/json"
-X POST
-H "Authorization:Bearer ${BL_TOKEN}"
-d "{\"title\":\"${VERSION} rpm\",\"tags\":[\"RC_rpm\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
"https://api-ssl.bitly.com/v4/bitlinks" > .rpm_res.json
- cat .rpm_res.json | jq -e -r .link > .rpm_short_link
- cat .rpm_short_link
artifacts:
when: always
paths:
- .rpm_short_link
- .rpm_res.json
create-deb-link:
tags: [ docker ]
image: alpine
stage: release-note
needs:
- installers
- release-check
only:
- schedules@ryzen-controller-team/ryzen-controller
before_script:
- apk add curl jq
script:
- URL=`cat .deb_link`
- VERSION=`cat .next_version`
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
- curl -H "Content-Type:application/json"
-X POST
-H "Authorization:Bearer ${BL_TOKEN}"
-d "{\"title\":\"${VERSION} deb\",\"tags\":[\"RC_deb\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
"https://api-ssl.bitly.com/v4/bitlinks" > .deb_res.json
- cat .deb_res.json | jq -e -r .link > .deb_short_link
- cat .deb_short_link
artifacts:
when: always
paths:
- .deb_short_link
- .deb_res.json
create-exe-link:
tags: [ docker ]
image: alpine
stage: release-note
needs:
- installers
- release-check
only:
- schedules@ryzen-controller-team/ryzen-controller
before_script:
- apk add curl jq
script:
- URL=`cat .exe_link`
- VERSION=`cat .next_version`
- VERSION_ESCAPED=`echo $VERSION | tr '.' '-'`
- curl -H "Content-Type:application/json"
-X POST
-H "Authorization:Bearer ${BL_TOKEN}"
-d "{\"title\":\"${VERSION} exe\",\"tags\":[\"RC_exe\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
"https://api-ssl.bitly.com/v4/bitlinks" > .exe_res.json
- cat .exe_res.json | jq -e -r .link > .exe_short_link
- cat .exe_short_link
artifacts:
when: always
paths:
- .exe_short_link
- .exe_res.json
update-changelog:
tags: [ docker ]
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
only:
- schedules@ryzen-controller-team/ryzen-controller
stage: release-note
script:
- release changelog
artifacts:
paths:
- CHANGELOG.md
###############################################################################
## RELEASE
###############################################################################
publish:
tags: [ docker ]
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
only:
- schedules@ryzen-controller-team/ryzen-controller
stage: release
needs:
- release-check
2019-08-04 15:02:03 +07:00
- node
- create-rpm-link
- create-deb-link
- create-exe-link
- update-changelog
script:
- VERSION=`cat .next_version`
- release --ci-commit-tag ${VERSION} commit-and-tag CHANGELOG.md package.json
- release --ci-commit-tag ${VERSION} add-download-link -d "Debian installer (and variant)" -n "ryzencontroller_${VERSION}_amd64.deb" -u "`cat .deb_short_link`"
- release --ci-commit-tag ${VERSION} add-download-link -d "Redhat installer (and variant)" -n "ryzencontroller_${VERSION}.amd64.rpm" -u "`cat .rpm_short_link`"
- release --ci-commit-tag ${VERSION} add-download-link -d "Windows installer" -n "RyzenControllerInstaller.exe" -u "`cat .exe_short_link`"
no-publish:
tags: [ docker ]
image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.20.4
only:
- schedules@ryzen-controller-team/ryzen-controller
stage: release
when: on_failure
dependencies: []
script:
- echo "Publish step not needed."