forked from aptible/supercronic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e07d2f2
commit 1271f37
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Release | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=readonly | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.4 | ||
- name: Install | ||
run: | | ||
make deps | ||
git clone https://github.com/sstephenson/bats.git --branch v0.4.0 --depth 1 "${HOME}/bats" | ||
export "PATH=${PATH}:${HOME}/bats/bin" | ||
- name: Test | ||
run: | | ||
make fmt | ||
git diff --exit-code ':(exclude)go.sum' | ||
make test | ||
- name: Build | ||
run: | | ||
mkdir -p dist | ||
export GOOS="linux" | ||
export CGO_ENABLED=0 | ||
for arch in amd64 386 arm arm64; do GOARCH="$arch" go build && file supercronic | grep 'statically linked' && mv supercronic "dist/supercronic-${GOOS}-${arch}"; done | ||
pushd dist | ||
ls -lah * | ||
file * | ||
sha1sum * | ||
sha256sum * | ||
popd | ||
- name: Release | ||
uses: "softprops/action-gh-release@v1" | ||
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-plain') | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
files: "dist/*" | ||
|