diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e867e45ac..0cbd1cb68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 37ecf349c..5da8f77cc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9b40cf42..e41021596 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }}