Skip to content

Action for releases including uploading assets, generating changelogs, handling pre-releases and a custom message.

License

Notifications You must be signed in to change notification settings

tomlinscote/action-automatic-releases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Releases with Custom Message

This action simplifies the GitHub release process by automatically uploading assets, generating changelogs, handling pre-releases, and so on. It includes a custom message placed before the generated changelog.

Contents

  1. Usage Examples
  2. Supported Parameters
  3. Event Triggers
  4. License

NOTE: This is a fork of GitHub Automatic Releases from marvinpinto/actions to customise it with a release message before the changelog.

Usage Examples

Automatically generate a pre-release when changes land on master

This example workflow will kick in as soon as changes land on master. After running the steps to build and test your project:

  1. It will create (or replace) a git tag called latest.
  2. Generate a changelog from all the commits between this, and the previous latest tag.
  3. Generate a new release associated with the latest tag (removing any previous associated releases).
  4. Update this new release with the specified title (e.g. Development Build).
  5. Add the message "My Message" to the release before the changelog.
  6. Upload LICENSE.txt and any jar files as release assets.
  7. Mark this release as a pre-release.
---
name: "pre-release"

on:
  push:
    branches:
      - "master"

jobs:
  pre-release:
    name: "Pre Release"
    runs-on: "ubuntu-latest"

    steps:
      # ...
      - name: "Build & test"
        run: |
          echo "done!"

      - uses: "tomlinscote/action-automatic-releases@latest"
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          automatic_release_tag: "latest"
          prerelease: true
          title: "Development Build"
          message: "My Message"
          files: |
            LICENSE.txt
            *.jar

Create a new GitHub release when tags are pushed to the repository

Similar to the previous example, this workflow will kick in as soon as new tags are pushed to GitHub. After building & testing your project:

  1. Generate a changelog from all the commits between this and the previous semver-looking tag.
  2. Generate a new release and associate it with this tag.
  3. Add the message "My Message" to the release before the changelog.
  4. Upload LICENSE.txt and any jar files as release assets.
---
name: "tagged-release"

on:
  push:
    tags:
      - "v*"

jobs:
  tagged-release:
    name: "Tagged Release"
    runs-on: "ubuntu-latest"

    steps:
      # ...
      - name: "Build & test"
        run: |
          echo "done!"

      - uses: "tomlinscote/action-automatic-releases@latest"
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          prerelease: false
          message: "My Message"
          files: |
            LICENSE.txt
            *.jar

Supported Parameters

Parameter Description Default
repo_token** GitHub Action token, e.g. "${{ secrets.GITHUB_TOKEN }}". null
draft Mark this release as a draft? false
prerelease Mark this release as a pre-release? true
automatic_release_tag Tag name to use for automatic releases, e.g latest. null
title Release title; defaults to the tag name if none specified. Tag Name
files Files to upload as part of the release assets. null
message** Message to go on the release before the changelog. null

Notes:

  • Parameters denoted with ** are required.
  • The files parameter supports multi-line glob patterns, see repository examples.

Event Triggers

The GitHub Actions framework allows you to trigger this (and other) actions on many combinations of events. For example, you could create specific pre-releases for release candidate tags (e.g *-rc*), generate releases as changes land on master (example above), nightly releases, and much more. Read through Workflow syntax for GitHub Actions for ideas and advanced examples.

License

The original source code for this project was released under the MIT License by marvinpinto. This project is not associated with GitHub.

About

Action for releases including uploading assets, generating changelogs, handling pre-releases and a custom message.

Resources

License

Stars

Watchers

Forks

Packages

No packages published