Giter VIP home page Giter VIP logo

undergroundwires / bump-everywhere Goto Github PK

View Code? Open in Web Editor NEW
61.0 5.0 11.0 1.43 MB

πŸš€ Automate versioning, changelog creation, README updates and GitHub releases using GitHub Actions,npm, docker or bash.

License: Apache License 2.0

Dockerfile 0.49% Shell 99.51%
continuous-integration continuous-deployment continuous-delivery gitops devops-tools github-actions devops pipeline github-action github

bump-everywhere's Introduction

bump-everywhere

πŸš€ Automate versioning, changelog creation, README updates and GitHub releases using GitHub Actions,npm, docker or bash.

contributions welcome Quality checks Bump & release Publish Test Code size Docker image size Auto-versioned by bump-everywhere

functions of bump-everywhere

Features

πŸ€– Allows you to automatically:

  • Bump your semantic git tag by increasing the patch version.
  • Create & commit a changelog file.
  • If npm project then bump package.json version and commit.
  • Check README.md file, if it has references to older version, update with never version.
  • Create a release on GitHub with auto-generated release notes.

βœ… Other features include:

  • Zero-configuration for most use-cases, but can still be customized.
  • It supports safe re-runs, it means that if you can run it for an already bumped or tagged repository, it'll not increase the version as everything is still up-to-date. It protects against recursive runs.

Usage

Option 1. Use GitHub actions

- uses: undergroundwires/bump-everywhere@master
  with:
    # Repository name with owner to bump & release. For example, undergroundwires/bump-everywhere
    # (Optional) Default: ${{ github.repository  }}
    repository: ''

    # Name of the user who will do the bump commit
    # (Optional) Default: ${{ github.actor }}
    user: ''

    # Commit message that will be used in the bump commit
    # (Optional) Default: ⬆️ bump everywhere to {{version}}
    commit-message: ''

    # Personal access token (PAT) used to clone & push to the repository.
    # If you use default, it'll not trigger other actions, but your own PAT then it triggers new actions
    # (Optional) Default: ${{ github.token }}
    git-token: ''

    # The type of the GitHub release
    # Options: 'release' | 'prerelease' | 'draft' | 'none' (does not release)
    # (Optional) Default: 'release'
    release-type: ''

    # Personal access token (PAT) used to release to GitHub.
    # Used only if release-type is not "none"
    # If you use default, it'll not trigger other actions, but your own PAT then it triggers new actions
    # (Optional) Default: ${{ github.token }}
    release-token: ''

    # Git branch to push the changes such as version tags, CHANGELOG file, version changes...
    # Configuring this should not be needed for most use-cases.
    # Use this only if you DO NOT use a single main default branch (e.g. `master` or `main`).
    # (Optional) Default: Default "git clone" behavior. Checks out to default branch of remote.
    branch: ''

↑

Option 2. Use Docker

  • To get the image you can either:

    • Pull from docker hub using docker pull undergroundwires/bump-everywhere:latest
    • Or build image yourself using docker build . --tag undergroundwires/bump-everywhere:latest
  • Run with arguments:

      args=(
        # Required:
        --repository "undergroundwires/privacy.sexy"
        --user "bot-user"
        --git-token "GitHub PAT for pushes"
        --release-type "prerelease"
        --release-token "GitHub PAT for releases"
        --commit-message "⬆️ bump to {{version}}"
        # Optional:
        --branch 'custom branch name'
      )
      docker run undergroundwires/bump-everywhere "${args[@]}"

↑

Option 3. Use npm

  1. (Optionally) install globally: npm install -g bump-everywhere
    • or locally: npm install bump-every-where --save-dev
  2. Run npx bump-everywhere <parameters...>

↑

Option 4. Use scripts

  1. Ensure bash (4 or newer), git, curl, jq exists in your environment
    • On Alpine: apk add bash git curl jq
    • On Windows: choco install git curl jq and use Git Bash
  2. Clone this repository: git clone https://github.com/undergroundwires/bump-everywhere
    • or optionally add this repository as git submodule: git submodule add https://github.com/undergroundwires/bump-everywhere
  3. Call the script: bash "scripts/bump-everywhere.sh" <parameters>

↑

Updating minor & major versions

bump-everywhere only increases your patch versions. You manually tag your last commit to update major & minor versions.

E.g. :

  git commit -m "bumped version to 1.4.0" --allow-empty
  git tag 1.4.0
  git push && git push origin 1.4.0

↑

All scripts

You can also use following scripts individually (check script files for usage, prerequisites & dependencies):

↑

Some example usages

↑

Support

Sponsor πŸ’•. Consider one time or recurring donation on GitHub Sponsors or any other way (undrgroundwires.dev/donate), every penny you leave will help development and maintenance of the project .

Star 🀩. If you do cannot do that you can just give it a star ⭐ . It helps me to see that the project is appreciated.

Badge πŸ“›. If you use the project, feel free to use the badge in the README.md of repository where you use bump-everywhere so we can have larger community that can help improving the project. It would look like Auto-versioned by bump-everywhere). You can add following in your markdown file:

[![Auto-versioned by bump-everywhere](https://github.com/undergroundwires/bump-everywhere/blob/master/badge.svg?raw=true)](https://github.com/undergroundwires/bump-everywhere)

↑

GitOps

CI/CD is fully automated for this repo using different GIT events and GitHub actions.

GitOps flow

↑

bump-everywhere's People

Contributors

undergroundwires avatar undergroundwires-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bump-everywhere's Issues

Monorepo support

Maybe add the possibility to do this also in monorepo.
If no package.json in root, check one folder layer down.

New version is wrong and cause a fail of pipeline

image

Version of bump-everywhere 1.3.0
But as I remember it started before I updated version.

I had reading the shell scripts for several days, but no luck.

Cloning Intentop/love-forever
Cloning into '/tmp/tmp.KjNkCL'...
Latest commit sha: 251a4907968843ecfa0efeeffaf5ec0b86c88859
Checking if this run is a re-run
Setting up credentials
Bumping and tagging version
Updating "1.5.3" to "1 5 3..1"
Creating tag: "1 5 3..1"
fatal: '1 5 3..1' is not a valid tag name.
Could not tag: "1 5 3..1"
Could not bump & tag

I suppose it's on my side but where? Wrong dots? ;)

Commit should be pushed before creating tag

First of all, thank you for creating this! I love the idea of bundling all of this boilerplate activity into an easy-to-use action.

My expectation is that the version bump in package.json and generated release notes should be included in the released version. However, it doesn't appear to be working that way. For example, in the last release of this project:

1.3.1...1.4.0

You can see that it includes the release notes and version bump from the previous release, rather than from 1.4.0. Looking at the code, I can see this is because the tag is created and pushed before the commit is made. I see two options:

  1. Move the logic that creates and pushes the tag to after the commit is pushed or
  2. Retag the tag after the commit is pushed to point to the hash of the commit

I prefer option 1 because it means that if the action ever fails to push the commit, there is no need to clean up the tags. Happy to submit a PR for this if this proposal is accepted.

Deployment does not work from forked repository

The problem is that deploy.yaml depends on a secret that cannot be read when it's triggered by PR.

When you create a pull request from forked repository to base repository, the workflow will be triggered on base repository. (documentation)
It’s by designed that encrypted secrets are not passed to the runner when a workflow is triggered from a forked repository. (documentation)

However we need the secret there otherwise creating release does not trigger publish workflow deployment (as documented) here.

Need to solve that πŸ€”

🎨 Usage of a prefix

I want to use a v for my version tags but this is currently not possible. One solution would be to extend the options and add a regex or extend the check to also expect v as possible parameter.

allow setting different release options

Allow user to customize the GitHub release behavior.
Introduce argument: release-type with following options:

  • none: No release is created
  • draft: Release draft is created
  • prerelease: Pre-release is created
  • release: Current behavior, a non-draft release is created and published

On first run of new project i get error

I added this workflow too the project:

name: Changelog
on:
  push:
    branches:
      - master
jobs:
  build:
    name: Bump version and release
    runs-on: ubuntu-latest
    steps:
      - name: Bump version and release
        uses: undergroundwires/[email protected]

Could not retrieve latest version. Version "404-tekst" is invalid (not in major.minor.patch format)
And this is the top of the package.json file:

{
  "package_name": "Mustasj webproject builder",
  "version": "1.3.0",
  "private": true,
  "description": "Gulp modules for an awesome front-end build tool",
  }

FR: Allow setting for branch name

Right now it expects the main branch to be named master, but ours is main, so the build fails. It would be nice to have that setting alongside repository and user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.