-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (50 loc) · 1.62 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
name: release
on:
push:
tags:
- 'v*'
env:
IMAGE_NAME: bridgekeeper
GITHUB_REF: ${{ github.ref }}
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 Docker 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 }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
TAG=${GITHUB_REF//refs\/tags\/v}
VERSION=${GITHUB_REF//refs\/tags\/v}
sed -i 's/version = "0.1.0"/version = "'${VERSION}'"/' Cargo.toml
docker build . -t $IMAGE_ID:$TAG
docker push $IMAGE_ID:$TAG
- name: Prepare helm chart
run: |
VERSION=${GITHUB_REF//refs\/tags\/v}
sed -i 's/0.0.1/'"${VERSION}"'/' charts/bridgekeeper/Chart.yaml
sed -i 's/dev/'"${VERSION}"'/' charts/bridgekeeper/values.yaml
- name: Publish helm chart
uses: stefanprodan/helm-gh-pages@master
with:
charts_dir: charts/
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