-
Notifications
You must be signed in to change notification settings - Fork 522
49 lines (49 loc) · 1.71 KB
/
release.yaml
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
44
45
46
47
48
49
name: Release
on:
push:
tags:
- 'v*'
jobs:
release-bins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: 1.19
- run: go install github.com/golang/mock/mockgen@v1.6.0
- uses: actions/setup-node@v2.4.0
- name: Build Web Page
run: make build-web
- name: Build go binaries
run: make release
- uses: softprops/action-gh-release@v1
with:
files: 'bin/*'
prerelease: ${{ contains(env.GIT_TAG, 'rc') }}
release-docker-images:
runs-on: ubuntu-latest
needs:
- release-bins
steps:
- uses: actions/checkout@v2
- run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- run: if ! echo $GIT_TAG | grep "rc" >/dev/null; then DOCKER_TAGS=chigusa/bililive-go:$GIT_TAG,chigusa/bililive-go:latest; else DOCKER_TAGS=chigusa/bililive-go:$GIT_TAG; fi; echo "DOCKER_TAGS=$DOCKER_TAGS" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.5.1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build the Docker image
uses: docker/build-push-action@v2.6.1
with:
file: Dockerfile
build-args: tag=${{ env.GIT_TAG }}
platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ env.DOCKER_TAGS }}