1111
1212env :
1313 GO_VERSION : 1.19
14- ZIG_VERSION : 0.10.0
1514
1615jobs :
1716 lint :
@@ -41,30 +40,25 @@ jobs:
4140 uses : actions/setup-go@v3
4241 with :
4342 go-version : ${{ env.GO_VERSION }}
44- - name : Setup zig
45- uses : goto-bus-stop/setup-zig@v2
46- with :
47- version : ${{ env.ZIG_VERSION }}
4843 - name : Build binary
4944 run : |
50- env CGO_ENABLED=1 \
51- CC="zig cc -target x86_64-linux-musl" \
52- CXX="zig c++ -target x86_64-linux-musl" \
53- go build
45+ mkdir build
46+ go build -o build ./...
5447 - name : Upload binary
5548 uses : actions/upload-artifact@v3
5649 with :
5750 name : bifrost
58- path : bifrost
51+ path : build/**
5952 - name : Update Github release
6053 if : startsWith(github.ref, 'refs/tags/')
6154 uses : softprops/action-gh-release@v1
6255 with :
6356 append_body : true
6457 generate_release_notes : true
65- files : bifrost
58+ files : build/**
6659
6760 images :
61+ if : startsWith(github.ref, 'refs/tags/')
6862 name : Build and push images to ghcr.io
6963 runs-on : ubuntu-latest
7064 concurrency :
@@ -78,25 +72,45 @@ jobs:
7872 - name : Set environment variables
7973 run : |
8074 echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-8)" >>"$GITHUB_ENV"
81- - name : Build image
75+ - name : Build bouncer image
8276 uses : redhat-actions/buildah-build@v2
83- id : build_image
77+ id : build_bouncer_image
8478 with :
8579 image : ${{ github.repository }}
86- build-args : |
87- GO_VERSION=${{ env.GO_VERSION }}
88- ZIG_VERSION=${{ env.ZIG_VERSION }}
80+ build-args : GO_VERSION=${{ env.GO_VERSION }}
81+ extra-args : --target=bouncer
8982 tags : >
9083 latest
9184 ${{ env.SHORT_SHA }}
9285 ${{ github.sha }}
9386 ${{ github.event.release.tag_name }}
9487 containerfiles : Dockerfile
95- - name : Push image
88+ - name : Build issuer image
89+ uses : redhat-actions/buildah-build@v2
90+ id : build_issuer_image
91+ with :
92+ image : ${{ github.repository }}
93+ build-args : GO_VERSION=${{ env.GO_VERSION }}
94+ extra-args : --target=issuer
95+ tags : >
96+ latest
97+ ${{ env.SHORT_SHA }}
98+ ${{ github.sha }}
99+ ${{ github.event.release.tag_name }}
100+ containerfiles : Dockerfile
101+ - name : Push bouncer image
102+ uses : redhat-actions/push-to-registry@v2
103+ with :
104+ registry : ghcr.io
105+ username : ${{ github.actor }}
106+ password : ${{ secrets.GITHUB_TOKEN }}
107+ image : ${{ steps.build_bouncer_image.outputs.image }}
108+ tags : ${{ steps.build_bouncer_image.outputs.tags }}
109+ - name : Push issuer image
96110 uses : redhat-actions/push-to-registry@v2
97111 with :
98112 registry : ghcr.io
99113 username : ${{ github.actor }}
100114 password : ${{ secrets.GITHUB_TOKEN }}
101- image : ${{ steps.build_image .outputs.image }}
102- tags : ${{ steps.build_image .outputs.tags }}
115+ image : ${{ steps.build_issuer_image .outputs.image }}
116+ tags : ${{ steps.build_issuer_image .outputs.tags }}
0 commit comments