diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 172757e..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 5699b12..6a22633 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ Some tools use and dev for h6n, many are in shell/bash could be use in other pro ## Version -v1.2.0: Valentin +v1.4.0: Gabriel ## release script -To use the release script it's simple `curl https://gitlab.g3e.fr/h6n/tools/-/raw/main/scripts/release.sh | bash -s - [param list]` +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]` In dev mode you can do `cat ./scripts/release.sh | bash -s - [param list]` diff --git a/docs/release.md b/docs/release.md index 54fc7b3..f07ef97 100644 --- a/docs/release.md +++ b/docs/release.md @@ -4,6 +4,17 @@ The naming policy is based on first names for this project. -## Release list +# 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 +- [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) diff --git a/docs/release/v1.3.0_xavier.md b/docs/release/v1.3.0_xavier.md new file mode 100644 index 0000000..28c8837 --- /dev/null +++ b/docs/release/v1.3.0_xavier.md @@ -0,0 +1,8 @@ +# Xavier v1.3.0 + +## Release feature + +- update readme +- update script +- add ci for forgejo +- clean old ci \ No newline at end of file diff --git a/docs/release/v1.4.0_gabriel.md b/docs/release/v1.4.0_gabriel.md new file mode 100644 index 0000000..5f9b7e9 --- /dev/null +++ b/docs/release/v1.4.0_gabriel.md @@ -0,0 +1,6 @@ +# 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 diff --git a/scripts/gitlab_release.sh b/scripts/gitlab_release.sh index 6a85d01..2d8d01c 100644 --- a/scripts/gitlab_release.sh +++ b/scripts/gitlab_release.sh @@ -17,7 +17,7 @@ exec_with_dry_run () { main () { - [[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://gitlab.g3e.fr/h6n/tools/-/raw/main/libs/shflags)" + [[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)" [[ -f ./.config/gitlab_release ]] && . ./.config/gitlab_release DEFINE_string 'artifact_path' '' 'Path of artifact list' 'a' diff --git a/scripts/release.sh b/scripts/release.sh index e62231c..cb5e6ce 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -34,7 +34,7 @@ edit_file () { } main () { - [[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://gitlab.g3e.fr/h6n/tools/-/raw/main/libs/shflags)" + [[ -f ./libs/shflags ]] && . ./libs/shflags || eval "$(curl --silent https://git.g3e.fr/H6N/tools/raw/branch/main/libs/shflags)" @@ -43,6 +43,7 @@ main () { DEFINE_boolean 'create_branch' false 'Creation de la branch' 'c' DEFINE_boolean 'dryrun' false 'Enable dry-run mode' 'd' 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' FLAGS "$@" || exit $? @@ -71,6 +72,8 @@ main () { echo "Release ${NAME} - ${VERSION}" 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} '/^## 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 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