Skip to content

Commit 2bc5d7b

Browse files
fix: use two seperate scripts for build-go and docker build
1 parent 2a9d75b commit 2bc5d7b

3 files changed

Lines changed: 46 additions & 34 deletions

File tree

.github/workflows/binaries.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Generate release-artifacts
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
generate:
8+
name: Generate cross-platform builds
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout the repository
12+
uses: actions/checkout@v2
13+
- name: Generate build files
14+
uses: thatisuday/go-cross-build@v1
15+
with:
16+
platforms: 'linux/amd64, darwin/amd64, windows/amd64'
17+
package: ''
18+
name: 'pulse-bridge'
19+
compress: 'true'
20+
dest: 'dist'

.github/workflows/build.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,37 @@ name: Build
33
on:
44
push:
55
branches: [ "main" ]
6+
tags:
7+
- "v*.*.*"
68
pull_request:
79
branches: [ "main","*" ]
810

911
jobs:
1012

11-
build:
13+
build-go:
1214
runs-on: ubuntu-latest
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
1517

16-
- name: Set up Go
17-
uses: actions/setup-go@v4
18-
with:
19-
go-version: '1.24'
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.24'
2022

21-
- name: Build
22-
run: go build -v ./...
23+
- name: Build
24+
run: go build -v ./...
2325

24-
- name: Test
25-
run: go test -v ./...
26+
- name: Test
27+
run: go test -v ./...
28+
29+
trigger-binaries:
30+
needs: build-go
31+
if: startsWith(github.ref, 'refs/tags/v')
32+
uses: ./.github/workflows/binaries.yml
33+
secrets: inherit
34+
35+
trigger-docker-build:
36+
needs: build-go
37+
if: startsWith(github.ref, 'refs/tags/v')
38+
uses: ./.github/workflows/docker.yml
39+
secrets: inherit
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
11
name: Build and Push Docker Image to GHCR
22

33
on:
4-
push:
5-
tags:
6-
- "v*.*.*"
7-
workflow_dispatch:
4+
workflow_call:
85

96
jobs:
10-
build-go:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- uses: actions/checkout@v4
15-
16-
- name: Set up Go
17-
uses: actions/setup-go@v4
18-
with:
19-
go-version: '1.24'
20-
21-
- name: Build
22-
run: go build -v ./...
23-
24-
- name: Test
25-
run: go test -v ./...
26-
277
build-and-push:
28-
needs: build-go
298
runs-on: ubuntu-latest
30-
if: ${{ github.ref_type == 'tag' }}
319

3210
permissions:
3311
contents: read
@@ -56,6 +34,6 @@ jobs:
5634
with:
5735
context: .
5836
push: true
59-
tags: ghcr.io/${{ github.repository_owner }}/pulsebridge:${{ steps.extract_version.outputs.VERSION }}
37+
tags: ghcr.io/${{ github.repository_owner }}/pulse-bridge:${{ steps.extract_version.outputs.VERSION }}
6038
cache-from: type=gha
6139
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)