GithubHelp home page GithubHelp logo

kirrg001 / create-gh-release-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taiki-e/create-gh-release-action

0.0 0.0 0.0 66 KB

GitHub Action for creating GitHub Releases based on changelog.

License: Apache License 2.0

Shell 95.83% JavaScript 4.17%

create-gh-release-action's Introduction

create-gh-release-action

build status

GitHub Action for creating GitHub Releases based on changelog.

Usage

This action creates GitHub Releases based on changelog that specified by changelog option.

Currently, changelog format and supported tag names have the following rule:

Inputs

Name Required Description Type Default
changelog false Path to changelog (variables $tag, $version, $prefix, and any string) String
title false Format of title (variables $tag, $version, $prefix, and any string) String $tag
draft false Create a draft release (true or false) Boolean false
branch false Reject releases from commits not contained in branches that match the specified pattern (regular expression) String
prefix false An optional pattern that matches a prefix for the release tag, before the version number (see action.yml for more) String

Outputs

Name Description
computed-prefix The computed prefix, including '-' and 'v'.
version The version number extracted from the tag. The tag name is a concatenation of computed-prefix and version.

Example workflow: Basic usage

name: Release

permissions:
  contents: write

on:
  push:
    tags:
      - v[0-9]+.*

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          # (Optional) Path to changelog.
          changelog: CHANGELOG.md
        env:
          # (Required) GitHub token for creating GitHub Releases.
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example workflow: Create a draft release

name: Release

permissions:
  contents: write

on:
  push:
    tags:
      - v[0-9]+.*

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          # (Optional) Path to changelog.
          changelog: CHANGELOG.md
          # (Optional) Create a draft release.
          # [default value: false]
          draft: true
        env:
          # (Required) GitHub token for creating GitHub Releases.
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example workflow: Custom title

You can customize the title of the release by title option.

Example of the created release.

name: Release

permissions:
  contents: write

on:
  push:
    tags:
      - v[0-9]+.*

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          # (Optional)
          changelog: CHANGELOG.md
          # (Optional) Format of title.
          # [default value: $tag]
          # [possible values: variables $tag, $version, and any string]
          title: $version
        env:
          # (Required) GitHub token for creating GitHub Releases.
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example workflow: No changelog

If the changelog option is not specified, the changelog is ignored and only the release created.

Example of the created release.

name: Release

permissions:
  contents: write

on:
  push:
    tags:
      - v[0-9]+.*

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        env:
          # (Required) GitHub token for creating GitHub Releases.
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Example workflow: Reject releases from outside of main branch

You can reject releases from commits not contained in branches that match the specified pattern by using branch option.

name: Release

permissions:
  contents: write

on:
  push:
    tags:
      - v[0-9]+.*

jobs:
  create-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: taiki-e/create-gh-release-action@v1
        with:
          # (Optional) Path to changelog.
          changelog: CHANGELOG.md
          # (Optional) Reject releases from commits not contained in branches
          # that match the specified pattern (regular expression)
          branch: main
        env:
          # (Required) GitHub token for creating GitHub Releases.
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Other examples

Compatibility

This action has been tested for action runners hosted by GitHub. To use this action in self-hosted runners or in containers, you will need to install at least the following:

  • bash, GNU Coreutils, GNU grep, GNU tar
  • curl
  • git
  • gh (GitHub CLI)

Related Projects

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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.