Skip to content

Commit 23975ed

Browse files
authored
spectro release workflow (#10)
1 parent 7521b14 commit 23975ed

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Spectro Release
2+
run-name: Release for Cluster API CloudStack ${{ github.event.inputs.release_version }}
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: 'Cluster API Version to Build'
8+
required: true
9+
default: '0.0.0'
10+
rel_type:
11+
type: choice
12+
description: Type of release
13+
default: 'rc'
14+
options:
15+
- release
16+
- rc
17+
jobs:
18+
builder:
19+
runs-on: ubuntu-latest
20+
env:
21+
SPECTRO_VERSION: ${{ github.event.inputs.release_version }}
22+
LEGACY_REGISTRY: us-docker.pkg.dev/palette-images/palette/cluster-api-cloudstack
23+
FIPS_REGISTRY: us-docker.pkg.dev/palette-images-fips/palette/cluster-api-cloudstack
24+
steps:
25+
- uses: mukunku/[email protected]
26+
id: checkTag
27+
with:
28+
tag: v${{ github.event.inputs.release_version }}-spectro
29+
- if: ${{ steps.checkTag.outputs.exists == 'true' }}
30+
run: |
31+
echo "Tag already exists for v${{ github.event.inputs.release_version }}-spectro..."
32+
exit 1
33+
- if: ${{ github.event.inputs.rel_type == 'rc' }}
34+
run: |
35+
echo "LEGACY_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev/cluster-api-cloudstack" >> $GITHUB_ENV
36+
echo "FIPS_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev-fips/cluster-api-cloudstack" >> $GITHUB_ENV
37+
- uses: actions/checkout@v3
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v1
40+
- name: Login to private registry
41+
uses: docker/login-action@v1
42+
with:
43+
registry: ${{ secrets.REGISTRY_URL }}
44+
username: ${{ secrets.REGISTRY_USERNAME }}
45+
password: ${{ secrets.REGISTRY_PASSWORD }}
46+
- name: Login to dev private registry
47+
uses: docker/login-action@v1
48+
with:
49+
registry: ${{ secrets.DEV_REGISTRY_URL }}
50+
username: ${{ secrets.REGISTRY_USERNAME }}
51+
password: ${{ secrets.REGISTRY_PASSWORD }}
52+
- name: Build Image
53+
env:
54+
REGISTRY: ${{ env.LEGACY_REGISTRY }}
55+
run: |
56+
make docker-build-all
57+
make docker-push-all
58+
- name: Build Image - FIPS Mode
59+
env:
60+
FIPS_ENABLE: yes
61+
REGISTRY: ${{ env.FIPS_REGISTRY }}
62+
run: |
63+
make docker-build-all
64+
make docker-push-all
65+
- name: Create Release
66+
if: ${{ github.event.inputs.rel_type == 'release' }}
67+
id: create_release
68+
uses: actions/create-release@v1
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
with:
72+
tag_name: v${{ github.event.inputs.release_version }}-spectro
73+
release_name: Release v${{ github.event.inputs.release_version }}-spectro
74+
body: |
75+
Release version v${{ github.event.inputs.release_version }}-spectro
76+
draft: false
77+
prerelease: false

0 commit comments

Comments
 (0)