Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit c29c679

Browse files
committed
chore: Update GitLab CI
1 parent 7942f04 commit c29c679

File tree

2 files changed

+199
-0
lines changed

2 files changed

+199
-0
lines changed

.gitlab-ci.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
stages:
2+
- test
3+
- release
4+
- build
5+
6+
test docker:
7+
stage: test
8+
image: griefed/docker-with-buildx:latest
9+
services:
10+
- name: docker:dind
11+
alias: docker
12+
variables:
13+
project_name: $CI_PROJECT_NAME
14+
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
15+
before_script:
16+
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" docker.io
17+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
18+
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
19+
- docker buildx create --use --name grfdbuilder
20+
script:
21+
- docker buildx build
22+
--push
23+
--platform linux/amd64,linux/arm/v7,linux/arm64
24+
--tag "$CI_REGISTRY_IMAGE:develop"
25+
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:develop" .
26+
except:
27+
refs:
28+
- tags
29+
variables:
30+
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
31+
32+
release:
33+
needs: ['test docker']
34+
stage: release
35+
image: griefed/gitlab-semantic-release:latest
36+
services:
37+
- name: docker:dind
38+
alias: docker
39+
variables:
40+
project_name: $CI_PROJECT_NAME
41+
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
42+
script:
43+
- npx semantic-release
44+
only:
45+
- master
46+
except:
47+
refs:
48+
- tags
49+
variables:
50+
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
51+
52+
build:
53+
stage: build
54+
image: griefed/docker-with-buildx:latest
55+
services:
56+
- name: docker:dind
57+
alias: docker
58+
variables:
59+
project_name: $CI_PROJECT_NAME
60+
SEMANTIC_RELEASE_PACKAGE: $CI_PROJECT_NAME
61+
before_script:
62+
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" docker.io
63+
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
64+
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
65+
- docker buildx create --use --name grfdbuilder
66+
script:
67+
- docker pull "$CI_REGISTRY_IMAGE:develop"
68+
- docker buildx build
69+
--push
70+
--platform linux/amd64,linux/arm/v7,linux/arm64
71+
--cache-from "$CI_REGISTRY_IMAGE:develop"
72+
--tag "$CI_REGISTRY_IMAGE:latest"
73+
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:$CI_COMMIT_TAG"
74+
--tag "index.docker.io/$DOCKERHUB_USER/$DOCKERHUB_REPO:latest" .
75+
only:
76+
- tags

.releaserc.yml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
branches: ['master','main']
2+
ci: true
3+
debug: true
4+
dryRun: false
5+
tagFormat: '${version}'
6+
7+
# Global plugin options (will be passed to all plugins)
8+
preset: 'conventionalcommits'
9+
gitlabUrl: 'https://git.griefed.de/' # your gitlab url
10+
11+
# Responsible for verifying conditions necessary to proceed with the release:
12+
# configuration is correct, authentication token are valid, etc...
13+
verifyConditions:
14+
- '@semantic-release/changelog'
15+
- '@semantic-release/git'
16+
- '@semantic-release/gitlab'
17+
18+
# Responsible for determining the type of the next release (major, minor or patch).
19+
# If multiple plugins with a analyzeCommits step are defined, the release type will be
20+
# the highest one among plugins output.
21+
# Look details at: https://github.com/semantic-release/commit-analyzer#configuration
22+
analyzeCommits:
23+
- path: '@semantic-release/commit-analyzer'
24+
releaseRules:
25+
- breaking: true
26+
release: major
27+
- type: build # Changes that affect the build system or external dependencies
28+
release: patch
29+
- type: chore # Other changes that don't modify src or test files
30+
release: false
31+
- type: ci # Changes to our CI configuration files and scripts
32+
release: false
33+
- type: docs # Documentation only changes
34+
release: false
35+
- type: feat # A new feature
36+
release: minor
37+
- type: fix # A bug fix
38+
release: patch
39+
- type: perf # A code change that improves performance
40+
release: patch
41+
- type: refactor # A code change that neither fixes a bug nor adds a feature
42+
release: false
43+
- type: revert # Reverts a previous commit
44+
release: patch
45+
- type: style # Changes that do not affect the meaning of the code
46+
release: false
47+
- type: test # Adding missing tests or correcting existing tests
48+
release: false
49+
50+
# Responsible for generating the content of the release note.
51+
# If multiple plugins with a generateNotes step are defined,
52+
# the release notes will be the result of the concatenation of each plugin output.
53+
generateNotes:
54+
- path: '@semantic-release/release-notes-generator'
55+
writerOpts:
56+
groupBy: 'type'
57+
commitGroupsSort: 'title'
58+
commitsSort: 'header'
59+
linkCompare: true
60+
linkReferences: true
61+
presetConfig:
62+
types: # looks like it only works with 'conventionalcommits' preset
63+
- type: 'build'
64+
section: '🦊 CI/CD'
65+
hidden: false
66+
- type: 'chore'
67+
section: 'Other'
68+
hidden: false
69+
- type: 'ci'
70+
section: '🦊 CI/CD'
71+
hidden: false
72+
- type: 'docs'
73+
section: '📔 Docs'
74+
hidden: false
75+
- type: 'example'
76+
section: '📝 Examples'
77+
hidden: false
78+
- type: 'feat'
79+
section: '🚀 Features'
80+
hidden: false
81+
- type: 'fix'
82+
section: '🛠 Fixes'
83+
hidden: false
84+
- type: 'perf'
85+
section: '⏩ Performance'
86+
- type: 'refactor'
87+
section: ':scissors: Refactor'
88+
hidden: false
89+
- type: 'revert'
90+
section: '👀 Reverts'
91+
- type: 'style'
92+
section: '💈 Style'
93+
- type: 'test'
94+
section: '🧪 Tests'
95+
hidden: false
96+
97+
# Responsible for preparing the release, for example creating or updating files
98+
# such as package.json, CHANGELOG.md, documentation or compiled assets
99+
# and pushing a commit.
100+
prepare:
101+
# - path: '@semantic-release/exec'
102+
# # Execute shell command to set package version
103+
# cmd: './deployment/version-plaintext-set.sh ${nextRelease.version}'
104+
# - path: '@semantic-release/exec'
105+
# cmd: './deployment/version-oas-set.sh ${nextRelease.version} openapi.yaml'
106+
# - path: '@semantic-release/exec'
107+
# verifyReleaseCmd: "echo ${nextRelease.version} > VERSION.txt"
108+
- path: '@semantic-release/changelog'
109+
# Create or update the changelog file in the local project repository
110+
- path: '@semantic-release/git'
111+
# Push a release commit and tag, including configurable files
112+
message: 'RELEASE: ${nextRelease.version}'
113+
assets: ['CHANGELOG.md']
114+
115+
# Responsible for publishing the release.
116+
publish:
117+
- path: '@semantic-release/gitlab'
118+
# Publish a GitLab release
119+
# (https://docs.gitlab.com/ce/user/project/releases/index.html#add-release-notes-to-git-tags)
120+
121+
success: false
122+
123+
fail: false

0 commit comments

Comments
 (0)