forked from scaleway/scaleway-cloud-controller-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (87 loc) · 2.54 KB
/
Copy pathrelease.yml
File metadata and controls
89 lines (87 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: release
on:
push:
tags:
- '*'
jobs:
prepare:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.tagName.outputs.tag }}
is_highest: ${{ steps.highestTag.outputs.is_highest }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@v3.0.2
id: tagName
- name: Highest tag
id: highestTag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
highest=$(git tag | grep -E "^v?([0-9]+\.)+[0-9]+$" | sort -r -V | head -n1)
if [ "${{ steps.tagName.outputs.tag }}" = "$highest" ]; then
echo is_highest=true >> $GITHUB_OUTPUT
else
echo is_highest=false >> $GITHUB_OUTPUT
fi
build:
needs: prepare
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Docker login
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push image
run: make docker-push-arch
env:
ARCH: ${{ matrix.arch }}
TAG: ${{ needs.prepare.outputs.tag }}
- name: Upload digest
uses: actions/upload-artifact@v7
with:
name: digests-${{ matrix.arch }}
path: digests/*
if-no-files-found: error
retention-days: 1
manifest:
needs: [prepare, build]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download digests
uses: actions/download-artifact@v8
with:
path: digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Docker login
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create version manifest
run: make docker-manifest
env:
IMAGE_TAG: ${{ needs.prepare.outputs.tag }}
- name: Create latest manifest
if: needs.prepare.outputs.is_highest == 'true'
run: make docker-manifest IMAGE_TAG=latest