From 4ed899689de30d84d5ca713e0c199ca9d4390bc2 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Wed, 9 Sep 2020 22:28:42 +0800 Subject: [PATCH] feat: add new md5sum option --- README.md | 5 ++++- action.yml | 7 +++++++ release.sh | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7edf09..18a9a98 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.
E.g., `extra_files: LICENSE README.md` | +| md5sum | **Optional** | Publish `.md5` along with artifacts, `TRUE` by default. | + ### Advanced Example @@ -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) diff --git a/action.yml b/action.yml index 815cea6..6286bbe 100644 --- a/action.yml +++ b/action.yml @@ -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' @@ -62,6 +67,8 @@ runs: - ${{ inputs.pre_command }} - ${{ inputs.build_command }} - ${{ inputs.extra_files }} + - ${{ inputs.md5sum }} + branding: icon: 'package' color: 'blue' diff --git a/release.sh b/release.sh index 0a4f85b..e988589 100755 --- a/release.sh +++ b/release.sh @@ -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 \ @@ -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