Skip to content

Commit

Permalink
ci: update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 9, 2024
1 parent aee042b commit 8a2e95e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 61 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,12 @@ on:

jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
go-version: [~1.18]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: "on"
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2

- name: Download Go modules
run: go mod tidy

- name: Build
run: go build -v ./...

- name: Test
run: go test ./...
go-version: stable
- run: go mod tidy
- run: go build -v ./...
- run: go test ./...
16 changes: 5 additions & 11 deletions .github/workflows/gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ name: generate
on:
push:
branches:
- 'master'
- "master"

jobs:
docs:
runs-on: ubuntu-latest
steps:
-
name: checkout
uses: actions/checkout@v2
-
name: setup go
uses: actions/setup-go@v2
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: docs
run: ./scripts/docs.sh
go-version: stable
- run: ./scripts/docs.sh
- uses: stefanzweifel/git-auto-commit-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,26 @@ name: goreleaser
on:
push:
tags:
- '*'
- "*"

jobs:
goreleaser:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
- uses: actions/setup-go@v2
with:
go-version: ~1.18
-
name: Set up Snapcraft
run: |
go-version: stable
- run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
- uses: goreleaser/goreleaser-action@v2
if: success()
with:
distribution: goreleaser-pro
version: latest
Expand All @@ -40,8 +31,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
AUR_KEY: ${{ secrets.AUR_KEY }}
14 changes: 7 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
push:
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ~1.18

- uses: actions/checkout@v2
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
# Use supplied Go version
skip-go-installation: true
Expand Down

0 comments on commit 8a2e95e

Please sign in to comment.