carlsberg / gh-releaser

GitHub CLI extension to simplify starting and closing releases in GitFlow-based projects.
MIT License
24 stars 2 forks source link
automation gh-extension github github-actions hacktoberfest release

GitHub Releaser

GitHub CLI extension to simplify starting and closing releases in GitFlow-based projects.

Installation

$ gh extensions install carlsberg/gh-releaser

Commands

gh releaser start <tag>

Starts a new release.

gh releaser close

Closes an existing release.

gh releaser update <new tag>

Updates the version for an open release.

gh releaser pr

Shows the Pull Request number for an open release.

Using in GitHub Workflows

Click to expand the example ```yaml name: Release on: workflow_dispatch: inputs: tag: description: Tag required: true jobs: start-release: name: Start Release runs-on: ubuntu-latest needs: setup steps: - name: Start Release run: | gh extensions install carlsberg/gh-releaser gh releaser start env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} qa-approval: name: QA Approval runs-on: ubuntu-latest needs: start-release environment: release steps: - name: Add approval label run: | gh extensions install carlsberg/gh-releaser gh pr edit $(gh releaser pr) --add-label "approved:qa" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} stakeholder-approval: name: Stakeholder Approval runs-on: ubuntu-latest needs: qa-approval environment: release steps: - name: Add approval label run: | gh extensions install carlsberg/gh-releaser gh pr edit $(gh releaser pr) --add-label "approved:stkh" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} close-release: name: Close Release runs-on: ubuntu-latest needs: stakeholder-approval environment: release steps: - name: Close Release run: | gh extensions install carlsberg/gh-releaser gh releaser close env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO: ${{ github.event.repository.name }} ```

Contributing

Please, see CONTRIBUTING.md to learn how you can contribute to this repository. Every contribution is welcome!

License

This project is released under the MIT License.