From b07556ceaa855db57040f2843fcd657275682217 Mon Sep 17 00:00:00 2001 From: nuxen Date: Sun, 1 Dec 2024 21:20:59 +0100 Subject: [PATCH] feat(ci): skip build on misc files (#1854) feat(ci): don't build on misc files --- .github/workflows/release.yml | 58 ++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e7bfac..aa4bdff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,21 @@ on: - "develop" tags: - 'v*' + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/images/**' + - 'config.toml' + - 'docker-compose.yml' + - 'Makefile' + - '**.md' pull_request: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/images/**' + - 'config.toml' + - 'docker-compose.yml' + - 'Makefile' + - '**.md' env: REGISTRY: ghcr.io @@ -62,7 +76,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest] + os: [ ubuntu-latest ] cgo: [ 1, 0 ] name: Test${{ matrix.cgo == 1 && ' CGO'|| '' }} ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -116,7 +130,7 @@ jobs: strategy: fail-fast: true matrix: - os: [macos-latest, windows-latest] + os: [ macos-latest, windows-latest ] cgo: [ 1, 0 ] name: Test${{ matrix.cgo == 1 && ' CGO'|| '' }} ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -166,11 +180,11 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ ubuntu-latest, macos-latest, windows-latest ] cgo: [ 1, 0 ] name: Automatic PGO ${{ matrix.cgo == 1 && 'CGO ' || ''}}run ${{ matrix.os }} runs-on: ${{ matrix.os }} - needs: [web] + needs: [ web ] env: GOPATH: ${{ startsWith(matrix.os, 'windows') && 'D:\golang\go' || '' }} GOCACHE: ${{ startsWith(matrix.os, 'windows') && 'D:\golang\cache' || '' }} @@ -207,7 +221,7 @@ jobs: goprofilecombine: name: Combine pprof profiles runs-on: ubuntu-latest - needs: [pgo, test, testother] + needs: [ pgo, test, testother ] steps: - name: Download pprof profiles uses: actions/download-artifact@v4 @@ -237,7 +251,7 @@ jobs: goreleaserbuild: name: Build distribution binaries runs-on: ubuntu-latest - needs: [web, goprofilecombine] + needs: [ web, goprofilecombine ] steps: - name: Checkout uses: actions/checkout@v4 @@ -267,7 +281,7 @@ jobs: with: distribution: goreleaser version: "~> v2" - args: release --clean --skip=validate --skip=publish --parallelism 5 + args: release --clean --skip=validate,publish --parallelism 5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -310,20 +324,20 @@ jobs: fail-fast: true matrix: platform: - - linux/386 - - linux/amd64 - - linux/amd64/v2 - - linux/amd64/v3 - - linux/arm/v6 - - linux/arm/v7 - - linux/arm64 -# - linux/mips64le -# - linux/mips64 - - linux/ppc64le -# - linux/riscv64 - - linux/s390x - - windows/amd64 - needs: [web, goprofilecombine] + - linux/386 + - linux/amd64 + - linux/amd64/v2 + - linux/amd64/v3 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64 + # - linux/mips64le + # - linux/mips64 + - linux/ppc64le + # - linux/riscv64 + - linux/s390x + - windows/amd64 + needs: [ web, goprofilecombine ] steps: - name: Checkout uses: actions/checkout@v4 @@ -407,7 +421,7 @@ jobs: name: Publish Docker multi-arch manifest if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' }} runs-on: ubuntu-latest - needs: [docker] + needs: [ docker ] steps: - name: Download image digests uses: actions/download-artifact@v4