Skip to content

Commit

Permalink
Add Github workflow to create releases with prebuilt binary
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom committed Dec 20, 2019
1 parent bacc614 commit 81d3d95
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create release
on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.13.x'
- uses: actions/checkout@v1
- name: Get dependencies
run: go mod download
- name: Install redis
run: sudo apt-get install -y -qq redis-server
- name: Run tests
run: go test -v -race ./...
- name: Build and archive
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build \
-trimpath -ldflags="-s -w -X=main.explicitVersion=${GITHUB_REF##*/}" -o bitmapist-server
GZIP=-9 tar czvf bitmapist-server-linux-amd64.tar.gz bitmapist-server
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
- name: Upload artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bitmapist-server-linux-amd64.tar.gz
asset_name: bitmapist-server-linux-amd64.tar.gz
asset_content_type: application/gzip

0 comments on commit 81d3d95

Please sign in to comment.