-
Notifications
You must be signed in to change notification settings - Fork 4
132 lines (120 loc) · 4.13 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
name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
branches:
- 'feature/oss-25-publish-versioned-chart'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: 3.12
POETRY_VERSION: 1.8.3
jobs:
# create_release:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Get previous tag
# id: previousTag
# run: |
# name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
# echo "previousTag: $name"
# echo "previousTag=$name" >> $GITHUB_ENV
#
# - name: Update CHANGELOG
# id: changelog
# uses: requarks/changelog-action@v1
# with:
# token: ${{ github.token }}
# fromTag: ${{ github.ref_name }}
# toTag: ${{ env.previousTag }}
# includeRefIssues: true
# writeToFile: false
# useGitmojis: true
# reverseOrder: true
#
# - name: Create Release
# uses: ncipollo/release-action@v1.14.0
# with:
# allowUpdates: true
# draft: true
# makeLatest: true
# name: ${{ github.ref_name }}
# body: ${{ steps.changelog.outputs.changes }}
# token: ${{ secrets.GITHUB_TOKEN }}
release_prod_helm:
runs-on: ubuntu-latest
name: Release PROD Helm Chart
# needs: [create_release]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/setup-helm@v4.2.0
- uses: chrisdickinson/setup-yq@latest
- name: Set env vars
# TODO: We need to make CHART_VERSION identical to APP_VERSION but without the semver extra stuff on dev branches
run: |
echo "CHART_VERSION=$(yq r deploy/twingate-operator/Chart.yaml version)" >> $GITHUB_ENV
echo "APP_VERSION=$(echo ${GITHUB_REF_NAME:1})" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Helm Publish (Dockerhub)
env:
REGISTRY: registry-1.docker.io
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | helm registry login $REGISTRY -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
helm package deploy/twingate-operator --version $CHART_VERSION --app-version $APP_VERSION
helm push kubernetes-operator-chart-$CHART_VERSION.tgz oci://$REGISTRY/twingate --debug
- name: Helm Publish (Github)
env:
REGISTRY: ghcr.io
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login -u twingate --password-stdin $REGISTRY
helm package deploy/twingate-operator --version $CHART_VERSION --app-version $APP_VERSION
helm push kubernetes-operator-chart-$CHART_VERSION.tgz oci://$REGISTRY/twingate/charts
# release_prod:
# name: Release PROD
# runs-on: ubuntu-latest
# needs: [create_release]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: Install and configure Poetry
# uses: snok/install-poetry@v1
# with:
# version: ${{ env.POETRY_VERSION }}
# virtualenvs-create: true
# virtualenvs-in-project: true
# installer-parallel: true
#
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Expose GitHub Runtime (ACTION_* env vars required for docker caching)
# uses: crazy-max/ghaction-github-runtime@v3
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - run: make multiarch-image-build-push-prod
# env:
# DOCKER_BUILDX_CACHE: --cache-to type=gha,mode=max --cache-from type=gha