Improve GitHub actions (#471)
This commit is contained in:
parent
992db39eb0
commit
82addda871
3 changed files with 24 additions and 51 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
|
@ -2,11 +2,7 @@ name: Build
|
|||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- actions
|
||||
pull_request:
|
||||
branches:
|
||||
- actions
|
||||
|
||||
jobs:
|
||||
|
||||
|
|
@ -15,7 +11,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Setup
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
|
|
@ -24,7 +19,9 @@ jobs:
|
|||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
**/node_modules
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
|
@ -34,12 +31,6 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# https://github.com/streamlink/streamlink/pull/2932
|
||||
# https://github.com/actions/checkout/issues/217#issuecomment-636481619
|
||||
# - name: Fetch tags
|
||||
# # run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
||||
# run: git fetch
|
||||
|
||||
- name: Install tools
|
||||
run: make install
|
||||
|
||||
|
|
|
|||
14
.github/workflows/docker.yml
vendored
14
.github/workflows/docker.yml
vendored
|
|
@ -1,16 +1,11 @@
|
|||
name: Docker
|
||||
|
||||
on:
|
||||
# push:
|
||||
# branches:
|
||||
# - actions
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Build
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- actions
|
||||
|
||||
jobs:
|
||||
|
||||
|
|
@ -20,6 +15,8 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install
|
||||
run: curl -sfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | sudo bash -s -- -b $GOPATH/bin v0.5.1
|
||||
|
|
@ -27,5 +24,10 @@ jobs:
|
|||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
|
||||
|
||||
- name: Build
|
||||
- name: Build latest
|
||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||
run: make publish-latest
|
||||
|
||||
- name: Build release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: make publish-release
|
||||
|
|
|
|||
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
|
|
@ -6,10 +6,8 @@ on:
|
|||
- Build
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- actions
|
||||
# tags:
|
||||
# - '*'
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
|
||||
|
|
@ -17,33 +15,15 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# - name: Setup
|
||||
# uses: actions/setup-go@v2
|
||||
# with:
|
||||
# go-version: 1.14
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# - uses: actions/cache@v2
|
||||
# with:
|
||||
# path: ~/go/pkg/mod
|
||||
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-go-
|
||||
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# fetch-depth: 0
|
||||
|
||||
# - name: Tools
|
||||
# run: make install
|
||||
|
||||
# - name: UI
|
||||
# run: make ui
|
||||
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue