-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (50 loc) · 1.83 KB
/
main.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
name: Create new release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Create new release
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/hybrid-cloud-postgresql-operator
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
TAG=${GITHUB_REF//refs\/tags\/v}
docker build . -t $IMAGE_ID:$TAG
docker push $IMAGE_ID:$TAG
- name: Prepare helm chart
env:
GITHUB_REF: ${{ github.ref }}
run: |
VERSION=${GITHUB_REF//refs\/tags\/v}
sed -i 's/0.0.1/'"${VERSION}"'/' helm/hybrid-cloud-postgresql-operator/Chart.yaml
sed -i 's/0.1.0/'"${VERSION}"'/' helm/hybrid-cloud-postgresql-operator/Chart.yaml
sed -i 's/dev/'"${VERSION}"'/' helm/hybrid-cloud-postgresql-operator/values.yaml
sed -i 's/0.0.1/'"${VERSION}"'/' helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml
sed -i 's/0.1.0/'"${VERSION}"'/' helm/hybrid-cloud-postgresql-operator-crds/Chart.yaml
- name: Publish helm chart
uses: stefanprodan/helm-gh-pages@master
with:
charts_dir: helm
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false