Skip to content

Commit

Permalink
added github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyashtrikul committed Mar 2, 2022
1 parent e07d2f2 commit 1271f37
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
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/*"

0 comments on commit 1271f37

Please sign in to comment.