Skip to content

Commit

Permalink
Release portable linux dist
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-j-h committed Jun 15, 2022
1 parent 756fc8e commit 8f94dbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ jobs:
fi
echo "::set-output name=version::${version}"
echo "::set-output name=os_arch::$(go env GOOS)-$(go env GOARCH)"
- name: Build and package
- name: Create macos dist
if: ${{ matrix.os == 'macos-latest' }}
env:
version: ${{ steps.meta.outputs.version }}
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make default package VERSION="$version"
- name: Create portable linux dist
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
version: ${{ steps.meta.outputs.version }}
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make default package VERSION="$version" extraldflags='-linkmode external -extldflags "-static"'
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ OUTPUT_DIR := "$(shell pwd)/build"
NAME := "quorum-signer"
VERSION := "0.1.0-SNAPSHOT"
OS_ARCH := "$(shell go env GOOS)-$(shell go env GOARCH)"
BUILD_LD_FLAGS=-s -w $(extraldflags)

default: clean tools checkfmt test build

Expand All @@ -22,6 +23,7 @@ build:
@mkdir -p ${OUTPUT_DIR}
@echo Output to ${OUTPUT_DIR}
@GOFLAGS="-mod=readonly" go build \
-ldflags='$(BUILD_LD_FLAGS)' \
-o "${OUTPUT_DIR}/dist/${NAME}-${VERSION}-${OS_ARCH}" \
.

Expand Down

0 comments on commit 8f94dbb

Please sign in to comment.