Release #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: read | |
jobs: | |
build-azure-ipoib-ipam-cni: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
actions: read | |
contents: read | |
strategy: | |
matrix: | |
include: | |
- os: linux | |
arch: amd64 | |
- os: linux | |
arch: arm | |
- os: linux | |
arch: arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 # v4.1.1 | |
- name: Setup Golang | |
uses: actions/setup-go@v4.1.0 # v4.1.0 | |
with: | |
go-version-file: go.mod | |
- name: Build binary | |
run: | | |
rm -rf ./bin | |
ARCH=${{ matrix.arch }} make build | |
mv bin/azure-ipoib-ipam-cni bin/azure-ipoib-ipam-cni-${{ matrix.os }}-${{ matrix.arch }} | |
- uses: actions/upload-artifact@v3.1.3 # v3.1.3 | |
with: | |
name: azure-ipoib-ipam-cni-${{ matrix.os }}-${{ matrix.arch }} | |
path: bin/azure-ipoib-ipam-cni-${{ matrix.os }}-${{ matrix.arch }} | |
if-no-files-found: error | |
- name: Login to GHCR | |
uses: docker/#-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: ${{ matrix.platforms }} | |
push: true | |
tags: ghcr.io/azure/azure-ipoib-ipam-cni:${{ matrix.os }}-${{ matrix.arch }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: | |
- build-azure-ipoib-ipam-cni | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3.0.2 # v3.0.2 | |
with: | |
path: ./artifacts | |
- name: Publish release | |
uses: softprops/action-gh-release@v1 # v1 | |
with: | |
files: | | |
./artifacts/azure-ipoib-ipam-cni-*-*/* |