Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hr3lxphr6j committed Sep 6, 2021
1 parent a47507b commit f43a7cf
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 278 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.17
- 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 }}
37 changes: 37 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
- name: Build
run: make build-web bililive
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
- name: Test
run: make build-web test
- name: Codecov
uses: codecov/codecov-action@v2
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ release-docker:

.PHONY: test
test:
@go test --cover ./src/...
@go test --cover -coverprofile=coverage.txt ./src/...

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Bililive-go
[![Build Status](https://travis-ci.com/hr3lxphr6j/bililive-go.svg?branch=master)](https://travis-ci.com/hr3lxphr6j/bililive-go)
[![CI](https://github.com/hr3lxphr6j/bililive-go/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/hr3lxphr6j/bililive-go/actions/workflows/tests.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/hr3lxphr6j/bililive-go)](https://goreportcard.com/report/github.com/hr3lxphr6j/bililive-go)
[![Github release](https://img.shields.io/github/release/hr3lxphr6j/bililive-go.svg)](https://github.com/hr3lxphr6j/bililive-go/releases/latest)
[![Docker Pulls](https://img.shields.io/docker/pulls/chigusa/bililive-go.svg)](https://hub.docker.com/r/chigusa/bililive-go/)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/lthibault/jitterbug v2.0.0+incompatible
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_golang v1.11.0
github.com/robertkrimen/otto v0.0.0-20191219234010-c382bd3c16ff
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/sirupsen/logrus v1.6.0
Expand Down
Loading

0 comments on commit f43a7cf

Please sign in to comment.