Skip to content

Commit

Permalink
feat: add new md5sum option
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyoucao577 committed Sep 9, 2020
1 parent 233ca81 commit 4ed8996
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Automatically publish `Go` binaries to Github Release Assets through Github Acti
- Rich parameters support for `go build`(e.g. `-ldflags`, etc.).
- Support package extra files into artifacts (e.g., `LICENSE`, `README.md`, etc).
- Support customize build command, e.g., use [packr2](https://github.com/gobuffalo/packr/tree/master/v2)(`packr2 build`) instead of `go build`.
- Support optional `.md5` along with artifacts.

## Usage

Expand Down Expand Up @@ -55,6 +56,8 @@ jobs:
| build_flags | **Optional** | Additional arguments to pass the `go build` command. |
| ldflags | **Optional** | Values to provide to the `-ldflags` argument. |
| extra_files | **Optional** | Extra files that will be packaged into artifacts either. Multiple files separated by space. Note that extra folders can be allowed either since internal `cp -r` already in use. <br>E.g., `extra_files: LICENSE README.md` |
| md5sum | **Optional** | Publish `.md5` along with artifacts, `TRUE` by default. |


### Advanced Example

Expand Down Expand Up @@ -95,4 +98,4 @@ jobs:

### More Examples
Welcome share your usage for other people's reference!
- https://github.com/wangyoucao577/go-release-action/wiki/More-Examples
- [wiki/More-Examples](https://github.com/wangyoucao577/go-release-action/wiki/More-Examples)
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ inputs:
description: 'Extra files that will be packaged into artifacts either.'
required: false
default: ''
md5sum:
description: 'Publish `.md5` along with artifacts.'
required: false
default: 'TRUE'

runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -62,6 +67,8 @@ runs:
- ${{ inputs.pre_command }}
- ${{ inputs.build_command }}
- ${{ inputs.extra_files }}
- ${{ inputs.md5sum }}

branding:
icon: 'package'
color: 'blue'
2 changes: 2 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ curl \
"${RELEASE_ASSETS_UPLOAD_URL}?name=${RELEASE_ASSET_NAME}${RELEASE_ASSET_EXT}"
echo $?

if [ ${INPUT_MD5SUM^^} == 'TRUE' ]; then
curl \
--fail \
-X POST \
Expand All @@ -73,3 +74,4 @@ curl \
-H "Authorization: Bearer ${INPUT_GITHUB_TOKEN}" \
"${RELEASE_ASSETS_UPLOAD_URL}?name=${RELEASE_ASSET_NAME}${RELEASE_ASSET_EXT}.md5"
echo $?
fi

0 comments on commit 4ed8996

Please sign in to comment.