-
Notifications
You must be signed in to change notification settings - Fork 8
142 lines (133 loc) · 4.32 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: flux operator tag and release
on:
workflow_dispatch:
inputs:
release_tag:
description: Custom release tag
type: string
required: true
jobs:
build-arm:
runs-on: ubuntu-latest
name: make and build arm
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set tag
run: |
echo "Tag for release is ${{ inputs.release_tag }}"
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV}
- uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: GHCR Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Add custom buildx ARM builder
run: |
docker buildx create --name armbuilder
docker buildx use armbuilder
docker buildx inspect --bootstrap
- name: Deploy Container
env:
tag: ${{ env.tag }}
run: make arm-deploy ARMIMG=ghcr.io/flux-framework/flux-operator:${tag}-arm
build:
runs-on: ubuntu-latest
strategy:
matrix:
command: [docker]
name: make and build ${{ matrix.command }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Set tag
run: |
echo "Tag for release is ${{ inputs.release_tag }}"
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV}
- name: GHCR Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Container
env:
tag: ${{ env.tag }}
run: |
image=ghcr.io/flux-framework/flux-operator-${{ matrix.command }}:v${tag}
img=ghcr.io/flux-framework/flux-operator:v${tag}
make ${{ matrix.command }}-build BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image}
- name: Deploy Container
env:
tag: ${{ env.tag }}
run: |
image=ghcr.io/flux-framework/flux-operator-${{ matrix.command }}:v${tag}
img=ghcr.io/flux-framework/flux-operator:v${tag}
make ${{ matrix.command }}-push BUNDLE_IMG=${image} IMG=${img} CATALOG_IMG=${image}
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Set tag
run: |
echo "Tag for release is ${{ inputs.release_tag }}"
echo "tag=${{ inputs.release_tag }}" >> ${GITHUB_ENV}
- name: Install
run: conda create --quiet --name fo twine
- name: Install dependencies
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate fo
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
tag: ${{ env.tag }}
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate fo
cd sdk/python/v1alpha2/
pip install -e .
python setup.py sdist bdist_wheel
cd dist
wheelfile=$(ls fluxoperator-*.whl)
wheelfile=$(echo "$wheelfile" | sed "s/fluxoperator-//")
wheelfile=$(echo "$wheelfile" | sed "s/-py3-none-any.whl//")
echo "Release for Python is ${wheelfile}"
echo "Release for flux operator is ${tag}"
cd ../
if [[ "${wheelfile}" == "${tag}" ]]; then
echo "Versions are correct, publishing."
twine upload dist/*
else
echo "Versions are not correct, please fix and upload locally."
fi
- name: Build release manifests
env:
tag: ${{ env.tag }}
run: |
make build-config-arm ARMIMG=ghcr.io/flux-framework/flux-operator:${tag}-arm
make build-config IMG=ghcr.io/flux-framework/flux-operator:v${tag}
- name: Release Flux Operator
uses: softprops/action-gh-release@v1
with:
name: Flux Operator Release v${{ env.tag }}
tag_name: ${{ env.tag }}
generate_release_notes: true
files: |
examples/dist/flux-operator-arm.yaml
examples/dist/flux-operator.yaml
env:
GITHUB_REPOSITORY: flux-framework/flux-operator