Improve GitHub actions (#471)

This commit is contained in:
andig 2020-11-23 21:53:49 +01:00 • committed by GitHub
parent 992db39eb0
commit 82addda871
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 51 deletions

View file

@ -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

View file

@ -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

View file

@ -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 }}