Compare commits
No commits in common. "main" and "#2" have entirely different histories.
7 changed files with 63 additions and 33 deletions
58
.gitlab-ci.yml
Normal file
58
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
default:
|
||||||
|
image: debian:11
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- publish
|
||||||
|
- release
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
image: golang:1.21-alpine
|
||||||
|
before_script:
|
||||||
|
- apk update && apk add --no-cache make git
|
||||||
|
script:
|
||||||
|
- make build_password
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- ./bin/*
|
||||||
|
|
||||||
|
publish_main:
|
||||||
|
stage: publish
|
||||||
|
image: golang:1.21-alpine
|
||||||
|
variables:
|
||||||
|
VER: latest
|
||||||
|
before_script:
|
||||||
|
- apk update && apk add --no-cache make git curl
|
||||||
|
script:
|
||||||
|
- make publish_password
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
only:
|
||||||
|
- main
|
||||||
|
|
||||||
|
release_tag:
|
||||||
|
stage: publish
|
||||||
|
image: golang:1.21-alpine
|
||||||
|
variables:
|
||||||
|
VER: ${CI_COMMIT_TAG}
|
||||||
|
before_script:
|
||||||
|
- apk update && apk add --no-cache make git curl
|
||||||
|
script:
|
||||||
|
- make publish_password
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
|
||||||
|
release_job:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
before_script:
|
||||||
|
- apk update && apk add --no-cache bash curl
|
||||||
|
script:
|
||||||
|
- bash ./scripts/gitlab_release.sh -r ./docs/release/$CI_COMMIT_TAG* -a ./bin/
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
|
@ -4,11 +4,11 @@ Some tools use and dev for h6n, many are in shell/bash could be use in other pro
|
||||||
|
|
||||||
## Version
|
## Version
|
||||||
|
|
||||||
v1.4.0: Gabriel
|
v1.2.0: Valentin
|
||||||
|
|
||||||
## release script
|
## release script
|
||||||
|
|
||||||
To use the release script it's simple `curl https://git.g3e.fr/H6N/tools/raw/branch/main/scripts/release.sh | bash -s - [param list]`
|
To use the release script it's simple `curl https://gitlab.g3e.fr/h6n/tools/-/raw/main/scripts/release.sh | bash -s - [param list]`
|
||||||
|
|
||||||
In dev mode you can do `cat ./scripts/release.sh | bash -s - [param list]`
|
In dev mode you can do `cat ./scripts/release.sh | bash -s - [param list]`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,6 @@
|
||||||
|
|
||||||
The naming policy is based on first names for this project.
|
The naming policy is based on first names for this project.
|
||||||
|
|
||||||
# Release procedure
|
|
||||||
|
|
||||||
```
|
|
||||||
bash ./scripts/release.sh -t [VERSION] -n [RELEASE_NAME] -c
|
|
||||||
edit specifique files:
|
|
||||||
- ./release/next_release.md
|
|
||||||
bash ./scripts/release.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Release list
|
## Release list
|
||||||
- [v1.4.0 Gabriel](./docs/release/v1.4.0_gabriel.md)
|
|
||||||
- [v1.3.0 Xavier](./release/v1.3.0_xavier.md)
|
|
||||||
- [v1.2.0 Valentin](./release/v1.2.0_valentin.md)
|
|
||||||
- [v1.0.0 Damian](./release/v1.0.0_damian.md)
|
- [v1.0.0 Damian](./release/v1.0.0_damian.md)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
# Xavier v1.3.0
|
|
||||||
|
|
||||||
## Release feature
|
|
||||||
|
|
||||||
- update readme
|
|
||||||
- update script
|
|
||||||
- add ci for forgejo
|
|
||||||
- clean old ci
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
# Gabriel v1.4.0
|
|
||||||
|
|
||||||
## Release feature
|
|
||||||
|
|
||||||
- [PR](https://git.g3e.fr/H6N/tools/pulls/11) edit doc release.md file
|
|
||||||
- [PR](https://git.g3e.fr/H6N/tools/pulls/11) add procedure upgrade
|
|
||||||
|
|
@ -17,7 +17,7 @@ exec_with_dry_run () {
|
||||||
|
|
||||||
|
|
||||||
main () {
|
main () {
|
||||||
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)"
|
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://gitlab.g3e.fr/h6n/tools/-/raw/main/libs/shflags)"
|
||||||
[[ -f ./.config/gitlab_release ]] && . ./.config/gitlab_release
|
[[ -f ./.config/gitlab_release ]] && . ./.config/gitlab_release
|
||||||
|
|
||||||
DEFINE_string 'artifact_path' '' 'Path of artifact list' 'a'
|
DEFINE_string 'artifact_path' '' 'Path of artifact list' 'a'
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ edit_file () {
|
||||||
}
|
}
|
||||||
|
|
||||||
main () {
|
main () {
|
||||||
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)"
|
[[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://gitlab.g3e.fr/h6n/tools/-/raw/main/libs/shflags)"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -43,7 +43,6 @@ main () {
|
||||||
DEFINE_boolean 'create_branch' false 'Creation de la branch' 'c'
|
DEFINE_boolean 'create_branch' false 'Creation de la branch' 'c'
|
||||||
DEFINE_boolean 'dryrun' false 'Enable dry-run mode' 'd'
|
DEFINE_boolean 'dryrun' false 'Enable dry-run mode' 'd'
|
||||||
DEFINE_string 'release_path' './docs/release' 'Release path' 'p'
|
DEFINE_string 'release_path' './docs/release' 'Release path' 'p'
|
||||||
DEFINE_string 'doc_path' './docs/release.md' 'Documentation path' 'u'
|
|
||||||
DEFINE_string 'regex_version' 'v[0-9]*.[0-9]*.[0-9]*' 'Version Regex' 'r'
|
DEFINE_string 'regex_version' 'v[0-9]*.[0-9]*.[0-9]*' 'Version Regex' 'r'
|
||||||
|
|
||||||
FLAGS "$@" || exit $?
|
FLAGS "$@" || exit $?
|
||||||
|
|
@ -72,8 +71,6 @@ main () {
|
||||||
echo "Release ${NAME} - ${VERSION}"
|
echo "Release ${NAME} - ${VERSION}"
|
||||||
echo "Edit README file"
|
echo "Edit README file"
|
||||||
edit_file "${FLAGS_dryrun}" "sed ${SED_PARAM} 's/^${FLAGS_regex_version}: [A-Z|a-z| ]*$/${VERSION}: ${NAME}/' ./README.md" "./README.md" || return 1
|
edit_file "${FLAGS_dryrun}" "sed ${SED_PARAM} 's/^${FLAGS_regex_version}: [A-Z|a-z| ]*$/${VERSION}: ${NAME}/' ./README.md" "./README.md" || return 1
|
||||||
edit_file "${FLAGS_dryrun}" "sed ${SED_PARAM} '/^## Release list$/a\\
|
|
||||||
- [${VERSION} ${NAME}](${FLAGS_release_path}/${VERSION}_${LOWER_NAME}.md)' ${FLAGS_doc_path}" "${FLAGS_doc_path}" || return 1
|
|
||||||
edit_file "${FLAGS_dryrun}" "mv '${FLAGS_release_path}/next_release.md' '${FLAGS_release_path}/${VERSION}_${LOWER_NAME}.md'" "${FLAGS_release_path}/${VERSION}_${LOWER_NAME}.md" || return 1
|
edit_file "${FLAGS_dryrun}" "mv '${FLAGS_release_path}/next_release.md' '${FLAGS_release_path}/${VERSION}_${LOWER_NAME}.md'" "${FLAGS_release_path}/${VERSION}_${LOWER_NAME}.md" || return 1
|
||||||
exec_with_dry_run "${FLAGS_dryrun}" "git commit -s -S -m 'release-${VERSION}'" || return 1
|
exec_with_dry_run "${FLAGS_dryrun}" "git commit -s -S -m 'release-${VERSION}'" || return 1
|
||||||
exec_with_dry_run "${FLAGS_dryrun}" "git tag '${VERSION}' -s -m 'Release ${VERSION} ${NAME}'" || return 1
|
exec_with_dry_run "${FLAGS_dryrun}" "git tag '${VERSION}' -s -m 'Release ${VERSION} ${NAME}'" || return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue