-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (42 loc) · 1.29 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Create release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.0.0'
- uses: actions/checkout@v4
- 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