-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (90 loc) · 3.23 KB
/
spectro-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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Spectro Release
run-name: Release for Microk8s Cluster API Controlplane provider ${{ github.event.inputs.release_version }}
on:
workflow_dispatch:
inputs:
release_version:
description: 'Microk8s Cluster API Controlplane provider Version to Build'
required: true
default: '0.0.0'
rel_type:
type: choice
description: Type of release
options:
- release
- rc
jobs:
builder:
# edge-runner machine group is a bunch of machines in US Datacenter
runs-on: ubuntu-latest
# Initialize all secrets required for the job
# Ensure that the credentials are provided as encrypted secrets
env:
SPECTRO_VERSION: ${{ github.event.inputs.release_version }}
LEGACY_REGISTRY: us-docker.pkg.dev/palette-images/palette/cluster-api/capi-control-plane-provider-microk8s
FIPS_REGISTRY: us-docker.pkg.dev/palette-images-fips/palette/cluster-api/capi-control-plane-provider-microk8s
steps:
-
uses: mukunku/[email protected]
id: checkTag
with:
tag: v${{ github.event.inputs.release_version }}-spectro
-
if: ${{ steps.checkTag.outputs.exists == 'true' }}
run: |
echo "Tag already exists for v${{ github.event.inputs.release_version }}-spectro..."
exit 1
-
if: ${{ github.event.inputs.rel_type == 'rc' }}
run: |
echo "LEGACY_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev/cluster-api/capi-control-plane-provider-microk8s" >> $GITHUB_ENV
echo "FIPS_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev-fips/cluster-api/capi-control-plane-provider-microk8s" >> $GITHUB_ENV
-
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to private registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Login to dev private registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.DEV_REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Build Image
env:
REGISTRY: ${{ env.LEGACY_REGISTRY }}
run: |
make docker-build-all
make docker-push-all
-
name: Build Image - FIPS Mode
env:
FIPS_ENABLE: yes
REGISTRY: ${{ env.FIPS_REGISTRY }}
ALL_ARCH: amd64
run: |
make docker-build-all
make docker-push-all
-
name: Create Release
if: ${{ github.event.inputs.rel_type == 'release' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.release_version }}-spectro
release_name: Release v${{ github.event.inputs.release_version }}-spectro
body: |
Release version v${{ github.event.inputs.release_version }}-spectro
draft: false
prerelease: false