ColorlibHQ / AdminLTE

AdminLTE - Free admin dashboard template based on Bootstrap 5
https://adminlte.io
MIT License
44.05k stars 18.17k forks source link

[FEATURE] Add a script to bump the version #2809

Open XhmikosR opened 4 years ago

XhmikosR commented 4 years ago

So that it's automated. Should include package.json, package-lock.json, docs, and html files AFAICT

REJack commented 4 years ago

That's a nice idea, feel free to create a script 🤣

oliverlj commented 4 years ago

On a project I use registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 to automatically bump it. But it is based on conventional commits : (feat:, fix:)

This is the pipeline I used on gitlab

next-version:
  image: $IMAGE_GO_SEMREL_GITLAB
  stage: next-version
  script:
    - release next-version > .next-version
    - release changelog
  artifacts:
    paths:
      - .next-version
      - CHANGELOG.md
  except:
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for .*/
  only:
    - develop

bump-release-version:
  image: $IMAGE_NODE
  stage: bump-version
  script:
    - export RELEASE_VERSION=$(cat .next-version)
    - yarn version --no-git-tag-version --new-version $RELEASE_VERSION
  artifacts:
    paths:
      - .next-version
      - package.json
      - yarn.lock
  except:
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for .*/
  only:
    - develop

commit-release-version:
  image: $IMAGE_ALPINE
  stage: commit-version
  before_script:
    - export RELEASE_VERSION=$(cat .next-version)
    - apk add --no-cache git
    - git remote set-url origin https://gitlab-ci:$GL_TOKEN@gitlab.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git
    - git config --global user.email 'none@none.com'
    - git config --global user.name 'gitlab-ci'
  script:
    - git add CHANGELOG.md
    - git add package.json
    - git add yarn.lock
    - 'git commit -m "chore: version bump for $RELEASE_VERSION"'
    - git push origin HEAD:$CI_COMMIT_REF_NAME
  except:
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for .*/
  only:
    - develop

bump-development-version:
  image: $IMAGE_NODE
  stage: bump-version
  script:
    - yarn version --no-git-tag-version --new-version prerelease
    - npx -c 'echo "$npm_package_version"' > .next-development-version
  artifacts:
    paths:
      - .next-development-version
      - package.json
      - yarn.lock
  only:
    refs:
      - develop
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for \d*\.\d*\.\d*$/m

commit-development-version:
  image: $IMAGE_ALPINE
  stage: commit-version
  before_script:
    - export DEVELOPMENT_VERSION=$(cat .next-development-version)
    - apk add --no-cache git
    - git remote set-url origin https://gitlab-ci:$GL_TOKEN@gitlab.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME.git
    - git config --global user.email 'none@none.com'
    - git config --global user.name 'gitlab-ci'
  script:
    - git add package.json
    - git add yarn.lock
    - 'git commit -m "chore: version bump for $DEVELOPMENT_VERSION"'
    - git push origin HEAD:${CI_COMMIT_REF_NAME}
  only:
    refs:
      - develop
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for \d*\.\d*\.\d*$/m

tag-next-version:
  image: $IMAGE_GO_SEMREL_GITLAB
  stage: tag-next-version
  script:
    - release tag
  only:
    refs:
      - develop
    variables:
      - $CI_COMMIT_MESSAGE =~ /version bump for \d*\.\d*\.\d*$/m

in action : image image

craph commented 2 years ago

Hello, Any news on this feature ?