feat(ci): skip build if no source changes (cache build output by hash)
This commit is contained in:
@@ -24,13 +24,29 @@ jobs:
|
||||
go-version: '1.26'
|
||||
cache: true
|
||||
|
||||
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
||||
id: hash-src
|
||||
with:
|
||||
patterns: |
|
||||
apps/device-agent/**/*.go
|
||||
apps/device-agent/go.mod
|
||||
apps/device-agent/go.sum
|
||||
|
||||
- uses: actions/cache@v3
|
||||
id: cache-build
|
||||
with:
|
||||
path: apps/device-agent/bin
|
||||
key: build-device-agent-${{ steps.hash-src.outputs.hash }}
|
||||
|
||||
- name: Generate Windows resources (UAC manifest + icon)
|
||||
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||
working-directory: apps/device-agent
|
||||
run: |
|
||||
go install github.com/tc-hib/go-winres@latest
|
||||
go-winres make
|
||||
|
||||
- name: Build all platforms
|
||||
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||
working-directory: apps/device-agent
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user