forked from openshift/cloud-provider-nutanix
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.22 KB
/
release.yaml
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
name: Generate release artefact
on:
push:
tags:
- "v*.*.*"
jobs:
build_release:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install devbox
run: curl -fsSL https://get.jetpack.io/devbox | bash -s -- -f
- name: Install devbox deps
run: devbox install
- name: Install tools
uses: redhat-actions/openshift-tools-installer@v1
with:
source: "github"
ko: "latest"
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ccm-nutanix
sep-tags: ","
sep-labels: ","
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Build container
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository }}/controller
TAGS: ${{ steps.meta.outputs.tags }}
LABELS: ${{ steps.meta.outputs.labels }}
PLATFORMS: linux/amd64
run: |
PTAGS=`echo $TAGS | sed 's/ccm-nutanix://g'`
export SOURCE_DATE_EPOCH=$(date +%s)
devbox run -- ko build --bare --image-label "$LABELS" -t "$PTAGS" --platform=$PLATFORMS .
- name: Generate image info
env:
NEW_IMG: ghcr.io/${{ github.repository }}/controller:${{ steps.meta.outputs.version }}
run: |
echo "## Images" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|Name|Link|" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|-|-|" >> ${{ github.workspace }}-CHANGELOG.txt
echo "|Nutanix Cloud Provider|[$NEW_IMG]($NEW_IMG)|" >> ${{ github.workspace }}-CHANGELOG.txt
- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
body_path: ${{ github.workspace }}-CHANGELOG.txt
generate_release_notes: true
append_body: true