Skip to content

Commit

Permalink
.github/workflows: Update make release
Browse files Browse the repository at this point in the history
Signed-off-by: Kfir Toledo <[email protected]>
  • Loading branch information
kfirtoledo committed Feb 28, 2024
1 parent 5db1161 commit d30da83
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Image release
name: Release Images and Binaries

on:
push:
tags:
- 'v**'

jobs:
build_and_push_to_ghcr:
name: Create docker release and publish to ghcr
release:
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -22,5 +21,32 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push ClusterLink images
run: make push-image IMAGE_VERSION=${{ github.ref_name }}
- name: Build images
run: make docker-build
- name: Build and compress linux binaries
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./linux/gwctl ./cmd/gwctl
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./linux/cl-adm ./cmd/cl-adm
tar -czvf clusterlink-linux-amd64.tar.gz --transform 's/linux/clusterlink/' ./linux
- name: Build and compress macOS binaries
run: |
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o ./os/gwctl ./cmd/gwctl
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o ./os/cl-adm ./cmd/cl-adm
tar -czvf clusterlink-darwin-amd64.tar.gz --transform 's/os/clusterlink/' ./os
- name: Build and compress Arm-based macOS binaries
run: |
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o ./osarm64/gwctl ./cmd/gwctl
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o ./osarm64/cl-adm ./cmd/cl-adm
tar -czvf clusterlink-darwin-arm64.tar.gz --transform 's/osarm64/clusterlink/' ./osarm64
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./clusterlink*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
# - name: Tag and push ClusterLink images with tag 'latest'
# run: make push-image
# - name: Tag and push ClusterLink images latest with tag ${{ github.ref_name }}
# run: make push-image IMAGE_VERSION=${{ github.ref_name }}
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ push-image: docker-build
docker push $(IMAGE_BASE)/cl-go-dataplane:$(IMAGE_VERSION)
docker tag gwctl:latest $(IMAGE_BASE)/gwctl:$(IMAGE_VERSION)
docker push $(IMAGE_BASE)/gwctl:$(IMAGE_VERSION)
docker tag cl-operator:latest $(IMAGE_BASE)/cl-operator:$(IMAGE_VERSION)
docker push $(IMAGE_BASE)/cl-operator:$(IMAGE_VERSION)

install:
cp ./bin/gwctl /usr/local/bin/
Expand Down

0 comments on commit d30da83

Please sign in to comment.