Skip to content

Commit

Permalink
fix(ci): update go version (#68)
Browse files Browse the repository at this point in the history
* fix(ci): update go version

* fix(ci): run on pr

* fix(ci): unify test and build pr
  • Loading branch information
ludviglundgren authored Aug 19, 2023
1 parent f8a1d83 commit 3ecab14
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 30 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,71 @@
name: goreleaser

on:
pull_request:
push:
branches:
- "master"
- "develop"
tags:
- '*'
- 'v*'

jobs:
goreleaser:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
cache: true

- name: Test
run: go test -v ./...

build:
name: Build Go binaries
needs: [ test ]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
cache: true

- name: Run GoReleaser build
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate --skip-publish --parallelism 99
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: qbittorrent-cli
path: |
dist/*.tar.gz
dist/*.zip
release:
name: Build and publish binaries
needs: [ test ]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
-
Expand All @@ -18,7 +77,8 @@ jobs:
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.17
go-version: 1.21
cache: true
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 3ecab14

Please sign in to comment.