Skip to content

Commit

Permalink
feat: update build tools of go-release-platform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sinlov committed Jul 30, 2023
1 parent 6b6a292 commit a5acb2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ jobs:
uses: ./.github/workflows/golang-ci.yml
secrets: inherit

# go-build-check-main:
# name: go-build-check-main
# needs:
# - version
# - golang-ci
# if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.base_ref == 'main' }}
# uses: ./.github/workflows/go-release-platform.yml
# secrets: inherit
# with:
# verison_name: latest

go-release-platform:
name: go-release-platform
needs:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/go-release-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ permissions:

jobs:
go-release-platform:
defaults:
run:
shell: bash
# working-directory: ${{ env.WORK_DIR }}
strategy:
matrix:
# You can add more, for any target you'd like! target list see: go tool dist list
Expand Down Expand Up @@ -68,16 +72,18 @@ jobs:
go mod vendor
# Replace with the name of your binary
binary_name=${{ env.DIST_BINARY_NAME }}
if [ "${{ matrix.os }}" = "windows-latest" ]; then
binary_name=${{ env.DIST_BINARY_NAME }}.exe
fi
dirname="${{ env.DIST_BINARY_NAME }}-${{ inputs.verison_name }}-${{ matrix.go_os }}-${{ matrix.go_arch }}"
# change build tag and ldflags if you need
go build -a -tags netgo -ldflags '-w -s --extldflags "-static -fpic"' -o $dirname/$binary_name ${{ env.DIST_BUILD_ENTRANCE }}
# add more resource to archive
mv doc/cmd.md "$dirname"
# mv doc/cmd.md "$dirname"
# archive and hash
if [ "${{ matrix.os }}" = "windows-latest" ]; then
Expand All @@ -89,6 +95,7 @@ jobs:
shasum -a 256 "$dirname.tar.gz" >> "$dirname.tar.gz.sha256"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
fi
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.go_os }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

```bash
$ curl -L --fail https://raw.githubusercontent.com/bridgewwater/temp-golang-cli-fast/main/temp-golang-cli-fast
# let template-golang-lib file folder under $PATH
# let temp-golang-cli-fast file folder under $PATH
$ chmod +x temp-golang-cli-fast
# see how to use
$ temp-golang-cli-fast -h
Expand Down

0 comments on commit a5acb2a

Please sign in to comment.