• Stars
    star
    3,625
  • Rank 11,663 (Top 0.3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 10 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“¦ :octocat: GitHub Action for creating GitHub Releases
πŸ“¦ :octocat:

action gh-release

A GitHub Action for creating GitHub Releases on Linux, Windows, and macOS virtual environments


🀸 Usage

πŸš₯ Limit releases to pushes to tags

Typically usage of this action involves adding a step to a build that is gated pushes to git tags. You may find step.if field helpful in accomplishing this as it maximizes the reuse value of your workflow for non-tag pushes.

Below is a simple example of step.if tag gating

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')

You can also use push config tag filter

name: Main

on:
  push:
    tags:
      - "v*.*.*"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Release
        uses: softprops/action-gh-release@v1

⬆️ Uploading release assets

You can configure a number of options for your GitHub release and all are optional.

A common case for GitHub releases is to upload your binary after its been validated and packaged. Use the with.files input to declare a newline-delimited list of glob expressions matching the files you wish to upload to GitHub releases. If you'd like you can just list the files by name directly.

Below is an example of uploading a single asset named Release.txt

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Build
        run: echo ${{ github.sha }} > Release.txt
      - name: Test
        run: cat Release.txt
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: Release.txt

Below is an example of uploading more than one asset with a GitHub release

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Build
        run: echo ${{ github.sha }} > Release.txt
      - name: Test
        run: cat Release.txt
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            Release.txt
            LICENSE

⚠️ Note: Notice the | in the yaml syntax above ☝️. That let's you effectively declare a multi-line yaml string. You can learn more about multi-line yaml syntax here

⚠️ Note for Windows: Paths must use / as a separator, not \, as \ is used to escape characters with special meaning in the pattern; for example, instead of specifying D:\Foo.txt, you must specify D:/Foo.txt. If you're using PowerShell, you can do this with $Path = $Path -replace '\\','/'

πŸ“ External release notes

Many systems exist that can help generate release notes for you. This action supports loading release notes from a path in your repository's build to allow for the flexibility of using any changelog generator for your releases, including a human πŸ‘©β€πŸ’»

name: Main

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Generate Changelog
        run: echo "# Good things have arrived" > ${{ github.workspace }}-CHANGELOG.txt
      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          body_path: ${{ github.workspace }}-CHANGELOG.txt
          # note you'll typically need to create a personal access token
          # with permissions to create releases in the other repo
          token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
        env:
          GITHUB_REPOSITORY: my_gh_org/my_gh_repo

πŸ’… Customizing

inputs

The following are optional as step.with keys

Name Type Description
body String Text communicating notable changes in this release
body_path String Path to load text communicating notable changes in this release
draft Boolean Indicator of whether or not this release is a draft
prerelease Boolean Indicator of whether or not is a prerelease
files String Newline-delimited globs of paths to assets to upload for release
name String Name of the release. defaults to tag name
tag_name String Name of a tag. defaults to github.ref
fail_on_unmatched_files Boolean Indicator of whether to fail if any of the files globs match nothing
repository String Name of a target repository in <owner>/<repo> format. Defaults to GITHUB_REPOSITORY env variable
target_commitish String Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to repository default branch.
token String Secret GitHub Personal Access Token. Defaults to ${{ github.token }}
discussion_category_name String If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "Managing categories for discussions in your repository."
generate_release_notes Boolean Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes. See the GitHub docs for this feature for more information
append_body Boolean Append to existing body instead of overwriting it

πŸ’‘ When providing a body and body_path at the same time, body_path will be attempted first, then falling back on body if the path can not be read from.

πŸ’‘ When the release info keys (such as name, body, draft, prerelease, etc.) are not explicitly set and there is already an existing release for the tag, the release will retain its original info.

outputs

The following outputs can be accessed via ${{ steps.<step-id>.outputs }} from this action

Name Type Description
url String Github.com URL for the release
id String Release ID
upload_url String URL for uploading assets to the release
assets String JSON array containing information about each uploaded asset, in the format given here (minus the uploader field)

As an example, you can use ${{ fromJSON(steps.<step-id>.outputs.assets)[0].browser_download_url }} to get the download URL of the first asset.

environment variables

The following step.env keys are allowed as a fallback but deprecated in favor of using inputs.

Name Description
GITHUB_TOKEN GITHUB_TOKEN as provided by secrets
GITHUB_REPOSITORY Name of a target repository in <owner>/<repo> format. defaults to the current repository

⚠️ Note: This action was previously implemented as a Docker container, limiting its use to GitHub Actions Linux virtual environments only. With recent releases, we now support cross platform usage. You'll need to remove the docker:// prefix in these versions

Permissions

This Action requires the following permissions on the GitHub integration token:

permissions:
  contents: write

When used with discussion_category_name, additional permission is needed:

permissions:
  contents: write
  discussions: write

GitHub token permissions can be set for an individual job, workflow, or for Actions as a whole.

Doug Tangren (softprops) 2019

More Repositories

1

envy

deserialize env vars into typesafe structs with rust
Rust
758
star
2

shiplift

🐳 πŸ¦€ rust interface for maneuvering docker containers
Rust
593
star
3

serverless-rust

⚑ πŸ¦€ a serverless framework plugin for rustlang applications
JavaScript
538
star
4

turnstyle

🎟️A GitHub Action for serializing workflow runs
TypeScript
286
star
5

hubcaps

a rust interface for github
Rust
280
star
6

atty

are you or are you not a tty?
Rust
254
star
7

dynomite

βš‘πŸ¦€ 🧨 make your rust types fit DynamoDB and visa versa
Rust
213
star
8

hyperlocal

πŸ”Œ ✨rustlang hyper bindings for local unix domain sockets
Rust
201
star
9

recap

deserialize typed structures from regex captures
Rust
165
star
10

cargo-thanks

πŸ’– πŸ¦€ give thanks to your fellow Rustaceans
Rust
162
star
11

lambda-rust

🐳 πŸ¦€ a dockerized lambda build env for rust applications
Shell
161
star
12

np

new sbt project generation made simple(r)
Scala
149
star
13

openapi

openapi schema serialization for rust
Rust
124
star
14

awesome-mdbook

πŸ•ΆοΈπŸ—ƒοΈ a card catalog of mdbooks for your reading curiosity
111
star
15

serverless-aws-rust

βš‘πŸ—οΈ template for new aws lambda serverless rust apps
Rust
96
star
16

serverless-aws-rust-http

βš‘πŸ—οΈ template for new aws lambda serverless rust http apps
Rust
90
star
17

picture-show

slip and slide picture shows for the web
Scala
77
star
18

goji

a rust interface for jira
Rust
72
star
19

lando

πŸ“¦ πŸš€ a smooth-talking smuggler of Rust HTTP functions into AWS lambda
Rust
69
star
20

fasttime

⏱️ A Fastly serverless compute@edge runtime for running wasm applications locally
Rust
60
star
21

tugboat

a small boat used for maneuvering docker vessels
Scala
58
star
22

serverless-aws-rust-multi

βš‘πŸ—οΈ template for new aws lambda serverless rust http apps
Rust
57
star
23

again

♻️ Retry faillible Rustlang std library futures
Rust
55
star
24

afterparty

rust github webhook server
Rust
55
star
25

coffeescripted-sbt

pour some coffee for scala
Scala
55
star
26

ls

[discontinued] a scala card catalog
Scala
54
star
27

sbt-growl-plugin

Growling sbt test results so you don't have to
Scala
54
star
28

less-sbt

type less css in your sbt projects
CSS
45
star
29

envy-store

πŸͺ deserialize AWS Parameter Store values into type safe structs
Rust
39
star
30

hubcat

hip cats and git hubs
Scala
34
star
31

zoey

taking scala to the zoo
Scala
29
star
32

json-env-logger

A structured JSON logger for Rust.
Rust
29
star
33

serverless-aws-rust-websockets

βš‘πŸ—οΈ template for new aws lambda websocket serverless rust apps
Rust
28
star
34

setup-aws-copilot

πŸ‘©β€βœˆοΈ A GitHub Action for setting up and configuring the AWS Copilot command line interface
TypeScript
25
star
35

treeline

rust in trees
Rust
25
star
36

semverfi

always faithful, always loyal semantic versioning
Scala
23
star
37

unplanned

instant http
Scala
21
star
38

base64

the 64th base of rfc4648
Scala
21
star
39

mint

a makefile linter
Rust
20
star
40

screenprints

reprints for your terminal screen
Rust
19
star
41

porteurbars

🚲 a tool for sharing portable git hosted project templates
Rust
19
star
42

git-codeowners

a git extension to work with CODEOWNERS files
Rust
19
star
43

heroic

zero to hero Heroku deployment for sbt
Scala
18
star
44

assembly-sbt

Deploy fat JARs. Restart processes.
Scala
18
star
45

cappi

the sweetest sbt plugin your microbenchmarks will ever meet
Scala
17
star
46

capgun

fire when ready
Rust
15
star
47

tubesocks

A comfortable and fashionable way to have bi-directional conversations with modern web servers.
Scala
14
star
48

ryu

A `Tornado Whirlwind Kick` scala client for the riak `raw` http interface
Scala
13
star
49

pine

process line output
Rust
13
star
50

waitout

awaits the completion of multiple async tasks
Rust
12
star
51

scuttlebutt

Listen in on all the gossip going on in your kubernetes cluster πŸ™Š
Rust
12
star
52

emoji-clock

πŸ•’ πŸ‡ I'm late I'm late for a very important date
Rust
12
star
53

rust-bin

πŸ—οΈπŸ—‘οΈ a recipe for Rust bins built, tested, and published with GitHub Actions
Shell
11
star
54

termsize

terminal size matters
Rust
11
star
55

unisockets

unix domain sockets that look just like tcp sockets
Scala
11
star
56

meow

a scala growl client that purs
Scala
11
star
57

serverless-aws-rust-kinesis

βš‘πŸ—οΈ template for new aws lambda serverless kinesis rust apps
Rust
11
star
58

zig-lambda-runtime

an aws lambda runtime for zig
Zig
11
star
59

northeast-scala-symposium

event site for the northeast scala symposium
Scala
11
star
60

typed-lambda

Ξ» formal type definitions for aws lambda events
Makefile
10
star
61

sigv4

πŸ”βœοΈ aws sigv4 signed requests on the command line
Rust
10
star
62

codeowners

a rust crate for working with CODEOWNERS files
Rust
9
star
63

captcha_with_question

First attempt at a rails plugin. A form captcha with a textual question.
Ruby
9
star
64

treeline-scala

Renders nested tree branches in unicode and ascii
Scala
9
star
65

jot

just a thought
Scala
9
star
66

unfiltered-websockets.g8

unfiltered websockets g8 template
Scala
9
star
67

serverless-localhost

TypeScript
9
star
68

diffset

A GitHub Action for producing lists of files that changed between branches
TypeScript
8
star
69

aws-crossing

🚸 Do cross AWS account work more efficiently
Rust
8
star
70

aws-credential-rotary

TypeScript
8
star
71

tee

tee for rustlang readers
Rust
8
star
72

serverless-yml-schema

a json schema file for serverless framework's serverless.yml file
8
star
73

guavapants

one pair of pants that makes both your guava _and_ scala types look good
Scala
8
star
74

serverless-lando

βš‘πŸ—οΈ template for new serverless lando apps
Makefile
8
star
75

sinatra-doc

self documentaion for your sinatra app's routes
Ruby
7
star
76

serverless-oncall

βš‘πŸ“Ÿ Easily manage oncall for your serverless services
TypeScript
7
star
77

serverless-crowbar

βš‘πŸ—οΈtemplate for new serverless crowbar apps
Makefile
7
star
78

action-time

7
star
79

unfiltered-gae.g8

unfiltered google app engine g8 template
Scala
7
star
80

gist

it's like git with an s between the i and t
Scala
7
star
81

sox

comfortable, well fitting documentation for your sbt settings
Scala
6
star
82

spakle

▁▇▁▄▃▂▄▄▆▆▅▃▅▁▂ just like nyc's skyline (or something like that)
Scala
6
star
83

dispatch-foursquare

databinder dispatch interface for foursquare api
Scala
6
star
84

muxup

demo meetup api python app
Python
6
star
85

porthole

tiny rust crate for resolving the next available network port
Rust
6
star
86

zig-envy

parse env variables into zig structs
Zig
6
star
87

unfiltered-basic-auth.g8

unfiltered basic auth example g8 template
Scala
5
star
88

pj

a pajama party for your json strings and streamers
Scala
5
star
89

opener

everyone loves a good opener
Scala
5
star
90

ls-sbt

shhhh not ready yet
Scala
5
star
91

unfiltered.g8

template for unfiltered app
Scala
5
star
92

ls-server

[discontinued] scala's local librarian
Scala
5
star
93

zig-graphql

a basic GraphQL client for zig
Zig
5
star
94

chrome-plugin.g8

g8 template for google chrome plugins
Scala
5
star
95

track-jacket

A slimly outfitted interface for getting your app up and running with marathon
Scala
4
star
96

stats

exporter of numbers, speaks statsd
Scala
4
star
97

enroute

πŸ›©οΈ a parsimonious http request router
Rust
4
star
98

sing

Scala
4
star
99

xray

πŸ•΅οΈ aws xray daemon client for rustlang applications
Rust
4
star
100

broadcast

A rustlang adapter for writing to multiple sources
Rust
4
star