Compare commits

..

2 commits
v0.1.0 ... main

Author SHA1 Message Date
0989865fdb
ci: new semantic release workflow
Some checks failed
Build / Checks (push) Successful in 46s
Build / Code Coverage (push) Successful in 1m8s
Build / Build (push) Successful in 37s
Release / Semantic Release (push) Has been cancelled
2025-02-25 19:48:54 +01:00
1f84712e51
ci: removed gitlab pipeline
All checks were successful
Build / Checks (push) Successful in 45s
Build / Code Coverage (push) Successful in 1m11s
Build / Build (push) Successful in 43s
2025-02-25 19:24:02 +01:00
3 changed files with 92 additions and 102 deletions

View file

@ -0,0 +1,20 @@
name: Release
on:
push:
branches:
- main
- beta
jobs:
release:
name: Semantic Release
runs-on: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Semantic Release
shell: bash
run: |
npm install -g semantic-release@23 conventional-changelog-conventionalcommits@7
semantic-release

View file

@ -1,102 +0,0 @@
image: golang:1.23
stages:
- test
- sonarcloud
- build
checks:
stage: test
script:
- go fmt $(go list ./...)
- go vet $(go list ./...)
code coverage:
stage: test
script:
- go test -covermode=count -coverprofile coverage.cov $(go list ./...)
- go tool cover -func=coverage.cov
- go tool cover -html=coverage.cov -o coverage.html
coverage: '/\(statements\)\W+\d+\.\d+%/'
artifacts:
paths:
- coverage.cov
- coverage.html
codecov.io:
stage: test
script:
- curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --import
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
- gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
- shasum -a 256 -c codecov.SHA256SUM
- chmod +x codecov
- go test -race -coverprofile=coverage.out -covermode=atomic
- ./codecov -t ${CODECOV_TOKEN}
rules:
- if: $CODECOV_TOKEN
when: on_success
# stage "sonarcloud" is only needed because of this issue:
# https://gitlab.com/gitlab-org/gitlab/-/issues/30632
sonarcloud-check:
stage: sonarcloud
# result of coverage is needed
needs:
- code coverage
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
rules:
- if: $SONAR_HOST_URL
when: on_success
# build template
# execute the following command for all os/arch combinations: go tool dist list
.compile:
stage: build
# no dependencies -> no download of artifacts from previous jobs/stages
dependencies: []
script:
- go build .
darwin-amd64:
extends: .compile
variables:
GOOS: "darwin"
GOARCH: "amd64"
darwin-arm64:
extends: .compile
variables:
GOOS: "darwin"
GOARCH: "arm64"
linux-amd64:
extends: .compile
variables:
GOOS: "linux"
GOARCH: "amd64"
linux-arm64:
extends: .compile
variables:
GOOS: "linux"
GOARCH: "arm64"
windows-amd64:
extends: .compile
variables:
GOOS: "windows"
GOARCH: "amd64"

72
.releaserc Normal file
View file

@ -0,0 +1,72 @@
{
"branches": [
"main",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "chore",
"release": "patch"
},
{
"type": "build",
"release": "patch"
},
{
"type": "ci",
"release": "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "chore",
"section": "Miscellaneous Chores"
}
]
}
}
],
[
"@semantic-release/github",
{
"successCommentCondition": false,
"failTitle": false
}
]
]
}