Skip to content
Snippets Groups Projects
Verified Commit 665da148 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

ci: automate releases

parent 67fd62c9
No related branches found
No related tags found
No related merge requests found
......@@ -3,42 +3,72 @@
# 1. Ensure code quality
# 2. Generate releases automatically
variables:
GIT_SUBMODULE_STRATEGY: normal
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}"
# Using the official Python Docker image as default
default:
image: python
# Install miss_hit
.miss_hit: &miss_hit
before_script:
- pip install miss_hit
# Pipeline stages
stages:
- static analysis
- package
- release
# Static code analysis jobs via MISS_HIT
style_check:
<<: *miss_hit
stage: static analysis
script:
- mh_style . --fix
metric_check:
<<: *miss_hit
stage: static analysis
script:
- mh_metric . --ci
lint_check:
<<: *miss_hit
stage: static analysis
script:
- mh_lint .
# TODO: Use git-archive-all and bake an archive that includes submodules
release_job:
# Create an archive of the code and its submodules
archive_all:
stage: package
rules:
- if: $CI_COMMIT_TAG
before_script:
- pip install git-archive-all
script:
- echo "Packaging source with submodules"
- git-archive-all --force-submodules "${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip"
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip"'
- git-archive-all --force-submodules "${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz"
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz"'
make_release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs: ["archive_all"]
rules:
- if: $CI_COMMIT_TAG # Run when we create a new tag
- if: $CI_COMMIT_TAG
script:
- echo "Running release_job for $TAG"
release:
tag_name: '$CI_COMMIT_TAG'
description: 'Automatic release for version $CI_COMMIT_TAG'
description: ./RELEASE.md
assets:
links:
- name: 'COMPLETE CODE: ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip'
url: "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.zip"
- name: 'COMPLETE CODE: ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz'
url: "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz"
[submodule "validation/rotor-db"]
path = validation/rotor-db
url = git@gitlab.uliege.be:thlamb/rotor-db.git
url = ../rotor-db.git
[submodule "src/libs/matlab_airfoil_toolbox"]
path = src/libs/matlab_airfoil_toolbox
url = git@gitlab.uliege.be:am-dept/matlab_airfoil_toolbox
url = ../../am-dept/matlab_airfoil_toolbox
......@@ -21,6 +21,12 @@ _Initial commit_: single rotor in hover/axial flows
### Fixed
## [0.0.0] - 2022-11-27
_Initial commit_: single rotor in hover/axial flows
[sem_ver]:<https://semver.org/spec/v2.0.0.html>
[keep_chglog]: <https://keepachangelog.com/en/1.0.0/>
[Unreleased]: https://gitlab.uliege.be/thlamb/rotare
[Unreleased]: https://gitlab.uliege.be/thlamb/rotare/compare/0.0.0...main
[0.0.0]: https://gitlab.uliege.be/thlamb/rotare/releases/tag/0.0.0
## Download
**WARNING**: Download the archive titled `COMPLETE CODE: rotare-<version>`
linked above, not the _source code_ ones. The latter are automatically generated
and do not contain all dependencies.
## About this release
_Initial commit_.
- Single rotor in hover/axial flows
- NOT YET VALIDATED
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment