-
Notifications
You must be signed in to change notification settings - Fork 21
76 lines (65 loc) · 2.28 KB
/
release.yml
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
name: Release HMC
on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version
run: |
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push HMC controller image
uses: docker/build-push-action@v6
with:
build-args: |
LD_FLAGS=-s -w -X github.com/Mirantis/hmc/internal/build.Version=${{ env.VERSION }} -X github.com/Mirantis/hmc/internal/telemetry.segmentToken=${{ secrets.SEGMENT_TOKEN }}
context: .
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/mirantis/hmc/controller:${{ env.VERSION }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Prepare HMC chart
run: VERSION="${{ env.VERSION }}" make hmc-chart-release
- name: Push charts to GHCR
run: REGISTRY_REPO="oci://ghcr.io/mirantis/hmc/charts" make helm-push
- name: Prepare manifests
run: make hmc-dist-release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: ${{ contains(env.VERSION, '-') }}
files: |
dist/install.yaml
templates/provider/hmc-templates/files/release.yaml
draft: true
- name: Build airgap bundle
env:
IMG: 'ghcr.io/mirantis/hmc/controller:${{ env.VERSION }}'
run: |
make airgap-package
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
- name: Upload airgap bundle
run: aws s3 cp bin/hmc-airgap-${{ env.VERSION }}.tgz s3://binary2a-mirantis-com/hmc-airgap-${{ env.VERSION }}.tgz