-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (51 loc) · 1.9 KB
/
set-version.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: Sets version on project
on:
workflow_call:
inputs:
version:
description: "Version to set"
type: string
required: true
commit_message:
description: "Commit message"
type: string
default: "Update version"
secrets:
token:
required: true
env:
CI_COMMIT_AUTHOR: Dac-Cloud-Bot
CI_COMMIT_AUTHOR_EMAIL: [email protected]
CI_COMMIT_MESSAGE: "[CI] ${{ inputs.commit_message }} to ${{ inputs.version }}"
HELM_REPOSITORY: https://libertyglobal.github.io/bundle-cryptor-service/charts
jobs:
set-version-tag-and-commit:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure Git
run: |
git config user.name ${{ env.CI_COMMIT_AUTHOR }}
git config user.email ${{ env.CI_COMMIT_AUTHOR_EMAIL }}
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.5.0
- name: GIT commit and push all changed files
run: |
sed -i 's|APP_VERSION = .*|APP_VERSION = '"'${{ inputs.version }}'"',|g' service/app.py
sed -i 's|^version:.*|version: ${{ inputs.version }}|g' helm/charts/service/Chart.yaml
sed -i 's|^appVersion:.*|appVersion: ${{ inputs.version }}|g' helm/charts/service/Chart.yaml
sed -i 's|^version:.*|version: ${{ inputs.version }}|g' helm/Chart.yaml
sed -i 's|^appVersion:.*|appVersion: ${{ inputs.version }}|g' helm/Chart.yaml
helm package --version ${{ inputs.version }} --app-version ${{ inputs.version }} helm -d charts/
helm repo index charts/ --url ${{ env.HELM_REPOSITORY }}
git add --all
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push origin main
git tag v${{ inputs.version }} -f
git push origin --tags -f