fix(deps): update github.com/longhorn/go-common-libs digest to d622157 #675
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: build | |
on: | |
push: | |
branches: | |
- master | |
- v* | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
build-amd64-binaries: | |
name: Build AMD64 binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Build binaries | |
- name: Run make ci | |
run: make ci | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.out | |
flags: unittests | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries_amd64_artifact | |
path: ./bin/* | |
build-arm64-binaries: | |
name: Build ARM64 binaries | |
runs-on: longhorn-infra-arm64-runners | |
steps: | |
- name: Install make curl git | |
run: | | |
sudo apt update | |
sudo apt-get -y install make curl git | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Build binaries | |
- name: Run make build | |
run: | | |
make build | |
make package | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binaries_arm64_artifact | |
path: ./bin/* | |
build-push-amd64-images: | |
name: Build and push AMD64 images | |
runs-on: ubuntu-latest | |
needs: build-amd64-binaries | |
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Declare branch | |
run: | | |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_ENV" | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: binaries_amd64_artifact | |
path: ./bin/ | |
- name: Add executable permission | |
run: | | |
chmod +x ./bin/* | |
- name: Copy bin folder to package | |
run: | | |
cp -r ./bin ./package/ | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# longhornio/longhorn-engine image | |
- name: docker-build-longhorn-engine | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
platforms: linux/amd64 | |
tags: longhornio/longhorn-engine:dry-build | |
file: package/Dockerfile | |
build-args: | | |
ARCH=amd64 | |
- name: docker-publish-longhorn-engine | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64 | |
tags: longhornio/longhorn-engine:${{ env.branch }}-head-amd64 | |
file: package/Dockerfile | |
sbom: true | |
build-args: | | |
ARCH=amd64 | |
- name: docker-build-longhorn-engine-with-tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
platforms: linux/amd64 | |
tags: longhornio/longhorn-engine:${{ github.ref_name }}-amd64 | |
file: package/Dockerfile | |
build-args: | | |
ARCH=amd64 | |
- name: docker-publish-longhorn-engine-with-tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64 | |
tags: longhornio/longhorn-engine:${{ github.ref_name }}-amd64 | |
file: package/Dockerfile | |
sbom: true | |
build-args: | | |
ARCH=amd64 | |
build-push-arm64-images: | |
name: Build and push ARM64 images | |
runs-on: longhorn-infra-arm64-runners | |
needs: build-arm64-binaries | |
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Install make curl git | |
run: | | |
sudo apt update | |
sudo apt-get -y install make curl git | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Declare branch and sha_short | |
run: | | |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_ENV" | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: binaries_arm64_artifact | |
path: ./bin/ | |
- name: Add executable permission | |
run: | | |
chmod +x ./bin/* | |
- name: Copy bin folder to package | |
run: | | |
cp -r ./bin ./package/ | |
- name: Login to Docker Hub | |
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# longhornio/longhorn-engine image | |
- name: docker-build-longhorn-engine | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
platforms: linux/arm64 | |
tags: longhornio/longhorn-engine:dry-build | |
file: package/Dockerfile | |
build-args: | | |
ARCH=arm64 | |
- name: docker-publish-longhorn-engine | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64 | |
tags: longhornio/longhorn-engine:${{ env.branch }}-head-arm64 | |
file: package/Dockerfile | |
sbom: true | |
build-args: | | |
ARCH=arm64 | |
- name: docker-build-longhorn-engine-with-tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
platforms: linux/arm64 | |
tags: longhornio/longhorn-engine:${{ github.ref_name }}-arm64 | |
file: package/Dockerfile | |
build-args: | | |
ARCH=arm64 | |
- name: docker-publish-longhorn-engine-with-tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64 | |
tags: longhornio/longhorn-engine:${{ github.ref_name }}-arm64 | |
file: package/Dockerfile | |
sbom: true | |
build-args: | | |
ARCH=arm64 | |
manifest-image: | |
name: Manifest images | |
runs-on: ubuntu-latest | |
needs: [build-push-amd64-images, build-push-arm64-images] | |
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Declare branch and sha_short | |
run: | | |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_ENV" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# longhornio/longhorn-engine image | |
- name: docker-pull-longhorn-engine | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
run: | | |
docker pull --platform linux/amd64 longhornio/longhorn-engine:${{ env.branch }}-head-amd64 | |
docker pull --platform linux/arm64 longhornio/longhorn-engine:${{ env.branch }}-head-arm64 | |
docker buildx imagetools create -t longhornio/longhorn-engine:${{ env.branch }}-head \ | |
longhornio/longhorn-engine:${{ env.branch }}-head-amd64 \ | |
longhornio/longhorn-engine:${{ env.branch }}-head-arm64 | |
- name: docker-pull-longhorn-engine-with-tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
docker pull --platform linux/amd64 longhornio/longhorn-engine:${{ github.ref_name }}-amd64 | |
docker pull --platform linux/arm64 longhornio/longhorn-engine:${{ github.ref_name }}-arm64 | |
docker buildx imagetools create -t longhornio/longhorn-engine:${{ github.ref_name }} \ | |
longhornio/longhorn-engine:${{ github.ref_name }}-amd64 \ | |
longhornio/longhorn-engine:${{ github.ref_name }}-arm64 |