Skip to content
Snippets Groups Projects
Commit 6d1d4a94 authored by bgm's avatar bgm Committed by bgm
Browse files

Add gitlab-ci.yml for CI/CD

parent 6baed1b4
No related branches found
No related tags found
No related merge requests found
# Based on https://martin-renze.de/posts/gitlab-ci-releases/
# https://docs.gitlab.com/ee/user/project/releases/release_cicd_examples.html
# https://about.gitlab.com/blog/2023/11/01/tutorial-automated-release-and-release-notes-with-gitlab/
stages:
- test
- prepare
- release
phpcs:
stage: test
image: michaelmcandrew/civicrm-buildkit:latest
script:
- civilint
- phpcs-civi --ignore=vendor,docs --report-json=gl-code-quality-report-tmp.json --report-full=gl-fullreport.txt --report-junit=gl-report.xml . || true
- cat gl-fullreport.txt
artifacts:
reports:
codequality: gl-report.xml
junit: gl-report.xml
release_notes:
stage: prepare
image: alpine:latest
rules:
- if: $CI_COMMIT_TAG
script:
- apk add curl jq
- 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG" | jq -r .notes > release_notes.md'
- cat release_notes.md
artifacts:
paths:
- release_notes.md
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: release_notes
artifacts: true
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Running release_job for $TAG"
release:
name: 'Version $CI_COMMIT_TAG'
description: release_notes.md
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
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