2019-06-03 23:09:16 +07:00
|
|
|
include:
|
|
|
|
- template: Dependency-Scanning.gitlab-ci.yml
|
|
|
|
- template: SAST.gitlab-ci.yml
|
2020-03-14 22:26:51 +07:00
|
|
|
- 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
|
2020-03-14 22:26:51 +07:00
|
|
|
- build
|
2019-02-28 19:52:24 +07:00
|
|
|
- installer
|
2019-07-31 03:57:40 +07:00
|
|
|
- release-note
|
|
|
|
- release
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
## TEST
|
|
|
|
###############################################################################
|
2019-06-03 23:09:16 +07:00
|
|
|
|
2020-08-17 18:51:22 +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
|
|
|
|
2020-08-17 18:51:22 +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
|
|
|
|
2020-08-17 18:51:22 +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
|
2020-03-14 22:26:51 +07:00
|
|
|
- cat .next_version
|
2019-08-04 15:02:03 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- .next_version
|
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
## INSTALL
|
|
|
|
###############################################################################
|
|
|
|
|
2019-02-28 19:52:24 +07:00
|
|
|
node:
|
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-02-28 19:52:24 +07:00
|
|
|
stage: install
|
|
|
|
tags: [ docker ]
|
2020-03-14 22:26:51 +07:00
|
|
|
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`
|
2020-03-14 22:26:51 +07:00
|
|
|
- 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
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
2020-03-14 22:26:51 +07:00
|
|
|
## BUILD
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
|
2020-03-14 22:26:51 +07:00
|
|
|
build:
|
2019-02-28 19:52:24 +07:00
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2020-03-14 22:26:51 +07:00
|
|
|
stage: build
|
2019-02-28 19:52:24 +07:00
|
|
|
tags: [ docker ]
|
2020-03-14 22:26:51 +07:00
|
|
|
image: storm1er/electron-builder-wine-dubnium:1.0.2
|
2019-02-28 19:52:24 +07:00
|
|
|
script:
|
2020-03-14 22:26:51 +07:00
|
|
|
- yarn build
|
2019-03-11 20:40:26 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-03-14 22:26:51 +07:00
|
|
|
- build/
|
|
|
|
needs:
|
2019-02-28 19:52:24 +07:00
|
|
|
- node
|
|
|
|
|
2019-07-31 03:57:40 +07:00
|
|
|
###############################################################################
|
|
|
|
## INSTALLER
|
|
|
|
###############################################################################
|
|
|
|
|
2020-03-14 22:26:51 +07:00
|
|
|
installers:
|
2019-03-11 20:40:26 +07:00
|
|
|
only:
|
2019-07-31 03:57:40 +07:00
|
|
|
- branches
|
|
|
|
- schedules@ryzen-controller-team/ryzen-controller
|
2019-03-11 20:40:26 +07:00
|
|
|
stage: installer
|
|
|
|
tags: [ docker ]
|
2020-03-14 22:26:51 +07:00
|
|
|
image: storm1er/electron-builder-wine-dubnium:1.0.2
|
2019-03-11 20:40:26 +07:00
|
|
|
script:
|
2020-03-14 22:26:51 +07:00
|
|
|
- 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:
|
2020-03-14 22:26:51 +07:00
|
|
|
- .cache
|
2019-03-11 20:40:26 +07:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-03-14 22:26:51 +07:00
|
|
|
- dist/win
|
|
|
|
- dist/rpm
|
|
|
|
- dist/deb
|
|
|
|
- .exe_link
|
2019-07-31 03:57:40 +07:00
|
|
|
- .rpm_link
|
2020-03-14 22:26:51 +07:00
|
|
|
- .deb_link
|
|
|
|
needs:
|
2019-03-11 20:40:26 +07:00
|
|
|
- node
|
2020-03-14 22:26:51 +07:00
|
|
|
- build
|
2019-07-31 03:57:40 +07:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
## RELEASE-NOTE
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
create-rpm-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
2020-03-14 22:26:51 +07:00
|
|
|
needs:
|
|
|
|
- installers
|
2019-07-31 03:57:40 +07:00
|
|
|
- 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}"
|
2020-03-14 22:26:51 +07:00
|
|
|
-d "{\"title\":\"${VERSION} rpm\",\"tags\":[\"RC_rpm\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
2019-07-31 03:57:40 +07:00
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .rpm_res.json
|
|
|
|
- cat .rpm_res.json | jq -e -r .link > .rpm_short_link
|
2020-03-14 22:26:51 +07:00
|
|
|
- cat .rpm_short_link
|
2019-07-31 03:57:40 +07:00
|
|
|
artifacts:
|
2020-03-14 22:26:51 +07:00
|
|
|
when: always
|
2019-07-31 03:57:40 +07:00
|
|
|
paths:
|
|
|
|
- .rpm_short_link
|
|
|
|
- .rpm_res.json
|
|
|
|
|
|
|
|
create-deb-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
2020-03-14 22:26:51 +07:00
|
|
|
needs:
|
|
|
|
- installers
|
2019-07-31 03:57:40 +07:00
|
|
|
- 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}"
|
2020-03-14 22:26:51 +07:00
|
|
|
-d "{\"title\":\"${VERSION} deb\",\"tags\":[\"RC_deb\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
2019-07-31 03:57:40 +07:00
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .deb_res.json
|
|
|
|
- cat .deb_res.json | jq -e -r .link > .deb_short_link
|
2020-03-14 22:26:51 +07:00
|
|
|
- cat .deb_short_link
|
2019-07-31 03:57:40 +07:00
|
|
|
artifacts:
|
2020-03-14 22:26:51 +07:00
|
|
|
when: always
|
2019-07-31 03:57:40 +07:00
|
|
|
paths:
|
|
|
|
- .deb_short_link
|
|
|
|
- .deb_res.json
|
|
|
|
|
|
|
|
create-exe-link:
|
|
|
|
tags: [ docker ]
|
|
|
|
image: alpine
|
|
|
|
stage: release-note
|
2020-03-14 22:26:51 +07:00
|
|
|
needs:
|
|
|
|
- installers
|
2019-07-31 03:57:40 +07:00
|
|
|
- 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}"
|
2020-03-14 22:26:51 +07:00
|
|
|
-d "{\"title\":\"${VERSION} exe\",\"tags\":[\"RC_exe\",\"RC_${VERSION_ESCAPED}\",\"RC\",\"tmp\"],\"long_url\":\"${URL}\",\"group_guid\":\"Bj4p9bnMV93\"}"
|
2019-07-31 03:57:40 +07:00
|
|
|
"https://api-ssl.bitly.com/v4/bitlinks" > .exe_res.json
|
|
|
|
- cat .exe_res.json | jq -e -r .link > .exe_short_link
|
2020-03-14 22:26:51 +07:00
|
|
|
- cat .exe_short_link
|
2019-07-31 03:57:40 +07:00
|
|
|
artifacts:
|
2020-03-14 22:26:51 +07:00
|
|
|
when: always
|
2019-07-31 03:57:40 +07:00
|
|
|
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
|
2020-03-14 22:26:51 +07:00
|
|
|
needs:
|
2019-07-31 03:57:40 +07:00
|
|
|
- release-check
|
2019-08-04 15:02:03 +07:00
|
|
|
- node
|
2019-07-31 03:57:40 +07:00
|
|
|
- create-rpm-link
|
|
|
|
- create-deb-link
|
|
|
|
- create-exe-link
|
|
|
|
- update-changelog
|
|
|
|
script:
|
|
|
|
- VERSION=`cat .next_version`
|
2020-03-14 22:26:51 +07:00
|
|
|
- release --ci-commit-tag ${VERSION} commit-and-tag CHANGELOG.md package.json
|
2019-07-31 03:57:40 +07:00
|
|
|
- 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`"
|
2020-03-14 22:26:51 +07:00
|
|
|
|
|
|
|
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."
|