Skip to content
Snippets Groups Projects
Commit 3ec18fb4 authored by Griefed's avatar Griefed :joystick:
Browse files

ci: Add CI/CD configuration files and dependency checker configuration

parent c3410ba8
No related branches found
No related tags found
No related merge requests found
stages:
- Gradle Test
- Documentation
- Release
- Build Release
Gradle Test:
image: griefed/baseimage-ubuntu-jdk-8:1.0.5
stage: Gradle Test
services:
- name: griefed/gitlab-ci-cd:1.0.1
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
before_script:
- echo "**** Running in $CI_JOB_ID ****"
- echo "**** Java location ****"
- which java
- echo "**** Java version ****"
- java -version
- echo "**** Allowing execution of gradlew ****"
- chmod +x gradlew
- echo "**** Ensure clean environment ****"
- ./gradlew about
script:
- echo "**** Building ServerPackCreator ****"
- ./gradlew build --info
- echo "**** Listing build directory ****"
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
build
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
build/libs
- LC_COLLATE=C ls -ah --group-directories-first --color=auto
build/libs/libraries
- echo "**** Renaming files to please the eye ****"
- mv
build/libs/serverpackcreatorexampleaddon.jar
build/libs/ServerPackCreatorExampleAddon.jar
- mv
build/libs/serverpackcreatorexampleaddon-javadoc.jar
build/libs/ServerPackCreatorExampleAddon-javadoc.jar
- mv
build/libs/serverpackcreatorexampleaddon-sources.jar
build/libs/ServerPackCreatorExampleAddon-sources.jar
artifacts:
paths:
- build/libs/ServerPackCreatorExampleAddon.jar
- build/libs/ServerPackCreatorExampleAddon-javadoc.jar
- build/libs/ServerPackCreatorExampleAddon-sources.jar
- build/reports/tests/test
expire_in: 1 week
except:
refs:
- tags
- webservice
variables:
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
Release:
needs:
- job: 'Gradle Test'
artifacts: false
stage: Release
image: griefed/gitlab-ci-cd:1.0.1
services:
- name: griefed/gitlab-ci-cd:1.0.1
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
script:
- npx semantic-release
only:
- master
- main
except:
refs:
- tags
variables:
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
Build Release:
image: griefed/baseimage-ubuntu-jdk-8:1.0.5
stage: Build Release
services:
- name: griefed/gitlab-ci-cd:1.0.1
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
before_script:
- echo "**** Running in $CI_JOB_ID ****"
- echo "**** Java location ****"
- which java
- echo "**** Java version ****"
- java -version
- echo "**** Allowing execution of gradlew ****"
- chmod +x gradlew
- echo "**** Ensure clean environment ****"
- ./gradlew about
script:
- echo "**** Building ServerPackCreator ****"
- ./gradlew build --info -x test
- echo "**** Listing build directory ****"
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
build
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
build/libs
- LC_COLLATE=C ls -ah --group-directories-first --color=auto
build/libs/libraries
- echo "**** Renaming files to please the eye ****"
- mv
build/libs/serverpackcreatorexampleaddon.jar
build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.jar
- mv
build/libs/serverpackcreatorexampleaddon-javadoc.jar
build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-javadoc.jar
- mv
build/libs/serverpackcreatorexampleaddon-sources.jar
build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-sources.jar
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
build/libs
- echo "**** Uploading packages ****"
- 'curl
--header "JOB-TOKEN: ${CI_JOB_TOKEN}"
--upload-file build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.exe
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.exe"'
- 'curl
--header "JOB-TOKEN: ${CI_JOB_TOKEN}"
--upload-file build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.jar
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.jar"'
- 'curl
--header "JOB-TOKEN: ${CI_JOB_TOKEN}"
--upload-file build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-javadoc.jar
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-javadoc.jar"'
- 'curl
--header "JOB-TOKEN: ${CI_JOB_TOKEN}"
--upload-file build/libs/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-sources.jar
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-sources.jar"'
- echo "**** Create asset links ****"
- 'curl
--request POST
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}"
--data tag_name="${CI_COMMIT_TAG}"
--data name="${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.exe"
--data url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.exe"
--data link_type="package"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"'
- 'curl
--request POST
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}"
--data tag_name="${CI_COMMIT_TAG}"
--data name="${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.jar"
--data url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.jar"
--data link_type="package"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"'
- 'curl
--request POST
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}"
--data tag_name="${CI_COMMIT_TAG}"
--data name="${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-javadoc.jar"
--data url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-javadoc.jar"
--data link_type="package"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"'
- 'curl
--request POST
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}"
--data tag_name="${CI_COMMIT_TAG}"
--data name="${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-sources.jar"
--data url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}-sources.jar"
--data link_type="package"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/${CI_COMMIT_TAG}/assets/links"'
only:
- tags
pages:
image: griefed/baseimage-ubuntu-jdk-8:1.0.5
stage: Documentation
services:
- name: griefed/gitlab-ci-cd:1.0.1
alias: docker
variables:
project_name: $CI_PROJECT_NAME
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
before_script:
- which java
- chmod +x gradlew
- ./gradlew about
script:
- ./gradlew build --info -x test
- cp -Rf build/docs/javadoc public
- LC_COLLATE=C ls -ahl --group-directories-first --color=auto
public
only:
- master
- main
artifacts:
paths:
- public
expire_in: 1 week
\ No newline at end of file
branches: ['master','main']
ci: true
debug: true
dryRun: false
tagFormat: '${version}'
# Global plugin options (will be passed to all plugins)
preset: 'conventionalcommits'
gitlabUrl: 'https://git.griefed.de/' # your gitlab url
# Responsible for verifying conditions necessary to proceed with the release:
# configuration is correct, authentication token are valid, etc...
verifyConditions:
- '@semantic-release/changelog'
- '@semantic-release/git'
- '@semantic-release/gitlab'
# Responsible for determining the type of the next release (major, minor or patch).
# If multiple plugins with a analyzeCommits step are defined, the release type will be
# the highest one among plugins output.
# Look details at: https://github.com/semantic-release/commit-analyzer#configuration
analyzeCommits:
- path: '@semantic-release/commit-analyzer'
releaseRules:
- type: breaking # Changes that break something makes something incompatible to ealier version
release: major
- type: build # Changes that affect the build system or external dependencies
release: patch
- type: chore # Other changes that don't modify src or test files
release: false
- type: ci # Changes to our CI configuration files and scripts
release: false
- type: docs # Documentation only changes
release: false
- type: feat # A new feature
release: minor
- type: fix # A bug fix
release: patch
- type: perf # A code change that improves performance
release: patch
- type: refactor # A code change that neither fixes a bug nor adds a feature
release: false
- type: revert # Reverts a previous commit
release: patch
- type: style # Changes that do not affect the meaning of the code
release: false
- type: test # Adding missing tests or correcting existing tests
release: false
# Responsible for generating the content of the release note.
# If multiple plugins with a generateNotes step are defined,
# the release notes will be the result of the concatenation of each plugin output.
generateNotes:
- path: '@semantic-release/release-notes-generator'
writerOpts:
groupBy: 'type'
commitGroupsSort: 'title'
commitsSort: 'header'
linkCompare: true
linkReferences: true
presetConfig:
types: # looks like it only works with 'conventionalcommits' preset
- type: 'build'
section: '🦊 CI/CD'
hidden: false
- type: 'chore'
section: 'Other'
hidden: false
- type: 'ci'
section: '🦊 CI/CD'
hidden: false
- type: 'docs'
section: '📔 Docs'
hidden: false
- type: 'example'
section: '📝 Examples'
hidden: false
- type: 'feat'
section: '🚀 Features'
hidden: false
- type: 'fix'
section: '🛠 Fixes'
hidden: false
- type: 'perf'
section: ' Performance'
hidden: false
- type: 'refactor'
section: ':scissors: Refactor'
hidden: false
- type: 'revert'
section: '👀 Reverts'
hidden: false
- type: 'style'
section: '💈 Style'
hidden: false
- type: 'test'
section: '🧪 Tests'
hidden: false
# Responsible for preparing the release, for example creating or updating files
# such as package.json, CHANGELOG.md, documentation or compiled assets
# and pushing a commit.
prepare:
# - path: '@semantic-release/exec'
# # Execute shell command to set package version
# cmd: './deployment/version-plaintext-set.sh ${nextRelease.version}'
# - path: '@semantic-release/exec'
# cmd: './deployment/version-oas-set.sh ${nextRelease.version} openapi.yaml'
# - path: '@semantic-release/exec'
# verifyReleaseCmd: "echo ${nextRelease.version} > VERSION.txt"
- path: '@semantic-release/changelog'
# Create or update the changelog file in the local project repository
- path: '@semantic-release/git'
# Push a release commit and tag, including configurable files
message: 'RELEASE: ${nextRelease.version}'
assets: ['CHANGELOG.md']
# Responsible for publishing the release.
publish:
- path: '@semantic-release/gitlab'
# Publish a GitLab release
# (https://docs.gitlab.com/ce/user/project/releases/index.html#add-release-notes-to-git-tags)
success: false
fail: false
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":enableGradleLite"
],
"gradle-lite": {
"enabled": true
},
"prConcurrentLimit": 5,
"labels": ["dependencies"],
"assignees": ["Griefed"]
}
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