48 lines
1.7 KiB
YAML
48 lines
1.7 KiB
YAML
|
stages:
|
||
|
- validation
|
||
|
- release
|
||
|
|
||
|
# Create YAML anchors to avoid code duplicate (note: an anchor cannot call
|
||
|
# another anchor as it will result in an array of array)
|
||
|
.apt_get_update: &apt_get_update
|
||
|
- apt-get update > /dev/null
|
||
|
|
||
|
.release_script_prep: &release_script_prep
|
||
|
- apt-get install --yes python3-dev python3-pip git > /dev/null
|
||
|
- git clone https://framagit.org/thombet/scripts-for-kodi-add-ons.git
|
||
|
- python3 -m pip --quiet install -r scripts-for-kodi-add-ons/create-new-add-on-release/requirements.txt
|
||
|
|
||
|
# Pre-release job: will be available in all the merge requests with release
|
||
|
# branches in order to verify the release can be actually created. The
|
||
|
# verification is done by running the release script in dry run mode.
|
||
|
pre-release:
|
||
|
stage: validation
|
||
|
# Do not get any artifacts from previous jobs
|
||
|
dependencies: []
|
||
|
rules:
|
||
|
# Run this job only on merge requests for release branches
|
||
|
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^release\//'
|
||
|
when: manual
|
||
|
before_script:
|
||
|
- *apt_get_update
|
||
|
- *release_script_prep
|
||
|
script:
|
||
|
- python3 scripts-for-kodi-add-ons/create-new-add-on-release/create-new-add-on-release.py --dry-run
|
||
|
|
||
|
# Release job: will create a new GitLab release with the latest commit on the
|
||
|
# main branch.
|
||
|
create-release:
|
||
|
stage: release
|
||
|
# Do not get any artifacts from previous jobs
|
||
|
dependencies: []
|
||
|
# Run this job only for new commits on the branch "main" and only as "manual"
|
||
|
# because it is not mandatory to release all the commits on mainline.
|
||
|
rules:
|
||
|
- if: '$CI_COMMIT_BRANCH == "main"'
|
||
|
when: manual
|
||
|
- when: never
|
||
|
before_script:
|
||
|
- *apt_get_update
|
||
|
- *release_script_prep
|
||
|
script:
|
||
|
- python3 scripts-for-kodi-add-ons/create-new-add-on-release/create-new-add-on-release.py
|