Skip to content

Commit

Permalink
build: build binaries for acr-credential-provider when release
Browse files Browse the repository at this point in the history
  • Loading branch information
zarvd committed Apr 26, 2022
1 parent 54c0e9b commit 1a8cd09
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,60 @@ jobs:
path: bin/azure-cloud-node-manager-${{ matrix.os }}-${{ matrix.arch }}.exe
if-no-files-found: error

build-acr-credential-provider:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm
- os: linux
arch: arm64
- os: windows
arch: amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Go version
run: echo "GO_VERSION=$(grep -Eo '^go ([0-9]+\.[0-9]+)$' go.mod | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Build binary for linux
if: matrix.os == 'linux'
run: |
rm -rf ./bin
ARCH=${{ matrix.arch }} make bin/azure-acr-credential-provider
mv bin/azure-acr-credential-provider bin/azure-acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}
- name: Build binary for windows
if: matrix.os == 'windows'
run: |
rm -rf ./bin
ARCH=${{ matrix.arch }} make bin/azure-acr-credential-provider.exe
mv bin/azure-acr-credential-provider.exe bin/azure-acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}.exe
- name: Upload artifact for linux
if: matrix.os == 'linux'
uses: actions/upload-artifact@v2
with:
name: acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}
path: bin/azure-acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload artifact for windows
if: matrix.os == 'windows'
uses: actions/upload-artifact@v2
with:
name: acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}
path: bin/azure-acr-credential-provider-${{ matrix.os }}-${{ matrix.arch }}.exe
if-no-files-found: error

publish:
runs-on: ubuntu-latest
needs:
- build-cloud-controller-manager
- build-cloud-node-manager
- build-acr-credential-provider
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -163,6 +212,7 @@ jobs:
files: |
./artifacts/cloud-node-manager-*-*/*
./artifacts/cloud-controller-manager-*-*/*
./artifacts/acr-credential-provider-*-*/*
- name: Update site release note
uses: peter-evans/create-pull-request@v3
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ $(BIN_DIR)/azure-cloud-node-manager.exe: $(PKG_CONFIG) $(wildcard cmd/cloud-node
$(BIN_DIR)/azure-cloud-controller-manager: $(PKG_CONFIG) $(wildcard cmd/cloud-controller-manager/*) $(wildcard cmd/cloud-controller-manager/**/*) $(wildcard pkg/**/*) ## Build binary for controller-manager.
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-controller-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-controller-manager

$(BIN_DIR)/azure-acr-credential-provider: $(PKG_CONFIG) $(wildcard cmd/acr-credential-provider/*) $(wildcard cmd/acr-credential-provider/**/*) $(wildcard pkg/**/*) ## Build binary for acr-credential-provider.
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider

$(BIN_DIR)/azure-acr-credential-provider.exe: $(PKG_CONFIG) $(wildcard cmd/acr-credential-provider/*) $(wildcard cmd/acr-credential-provider/**/*) $(wildcard pkg/**/*) ## Build binary for acr-credential-provider.
CGO_ENABLED=0 GOOS=windows GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-acr-credential-provider.exe $(shell cat $(PKG_CONFIG)) ./cmd/acr-credential-provider

## --------------------------------------
##@ Images
## --------------------------------------
Expand Down

0 comments on commit 1a8cd09

Please sign in to comment.