Skip to content

toyokumo/tools.release

Repository files navigation

toyokumo/tools.release

GitHub Actions for lint-and-test workflow

Common operations for releasing new version.

Installation

  • deps.edn

    {:aliases {:release {:extra-deps {com.github.toyokumo/tools.release {:git/tag "..."
                                                                         :git/sha "..."}}
                         :ns-default toyokumo.tools.release}}}
  • Run task

    clojure -X:release ${TASK_NAME} ${RELEASE_OPTION}

Getting started

  1. Create version file

    • Run clojure -X:release init :version-file "/path/to/version.clj"

    • Edit /path/to/version.clj as you like.

  2. Prepare the Makefile

      VERSION_FILE := /path/to/version.clj
      RELEASE_OPTION := :version-file ${VERSION_FILE}
    
      pre-prod-deploy:
      	clojure -X:release pre-prod-deploy ${RELEASE_OPTION}
    
      post-prod-deploy:
      	clojure -X:release post-prod-deploy ${RELEASE_OPTION}
    • If you’d like to use branches other than main/develop as your main/development branchs, please add the following to RELEASE_OPTION.

      RELEASE_OPTION := :version-file ${VERSION_FILE} :main-branch master :develop-branch dev
  3. Release!

    make pre-prod-deploy
    # ...
    # Deploy application
    # ...
    make post-prod-deploy

Release options

Option name Required Description

:version-file

Yes

Path to the file which defines version string.

:main-branch

No

Default value is "main".

:develop-branch

No

Default value is "develop".

:tag-prefix

No

Default value is "v".

All tasks

Task name Description

init

Generate a version file template in :version-file.

print-version

Print the current version.

bump-patch-version

Bump the patch version in :version-file.

bump-minor-version

Bump the minor version in :version-file.

bump-major-version

Bump the major version in :version-file.

add-snapshot

Add -SNAPSHOT to the current version in :version-file.

delete-snapshot

Delete -SNAPSHOT from the current version in :version-file.

pre-prod-deploy

Task before deploying to the production.

  • Delete -SNAPSHOT from the version string

post-prod-deploy

Task after deploying to the production.

  • Delete -SNAPSHOT from the version string

  • Commit all changes

  • Create a new tag with current version string

  • Push to :main-branch

  • Fetch :develop-branch

  • Switch to :develop-branch

  • Rebase changes between :main-branch

  • Bump the patch version

  • Add -SNAPSHOT to the version string

  • Commit all changes

  • Push to :develop-branch

License

Copyright 2021 Toyokumo,Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published