62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
default:
|
|
image: python:3.9
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
- pre-release
|
|
- release
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
# - python tests/test.py
|
|
- |
|
|
echo "TODO: run tests"
|
|
|
|
build:
|
|
stage: build
|
|
script:
|
|
- |
|
|
echo "TODO: build app (e.g. docker build)"
|
|
|
|
release:tag--dry-run:
|
|
stage: pre-release
|
|
image: node:16-buster-slim
|
|
before_script:
|
|
- apt-get update && apt-get upgrade -y --no-install-recommends git-core ca-certificates
|
|
- npm i -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/gitlab
|
|
script:
|
|
- |
|
|
echo "!!! THIS IS A DRY RUN !!!"
|
|
echo "NO RELEASE WILL BE CREATED"
|
|
- semantic-release --dry-run -b ${CI_COMMIT_REF_NAME}
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
when: never
|
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
|
when: never
|
|
- if: $CI_COMMIT_MSG =~ /^chore\(CHANGELOG\):/
|
|
when: never
|
|
|
|
release:tag:
|
|
stage: pre-release
|
|
image: node:16-buster-slim
|
|
before_script:
|
|
- apt-get update && apt-get upgrade -y --no-install-recommends git-core ca-certificates
|
|
- npm i -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/gitlab
|
|
script:
|
|
- semantic-release -b ${CI_COMMIT_REF_NAME}
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
when: never
|
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
|
when: always
|
|
- if: $CI_COMMIT_MSG =~ /^chore\(CHANGELOG\):/
|
|
when: never
|
|
|
|
release:publish:
|
|
stage: release
|
|
script:
|
|
- |
|
|
echo "TODO: release the app (e.g. publish tagged docker image)"
|