-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (57 loc) · 2.51 KB
/
release-tag.yml
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
# Github workflow
# https://stackoverflow.com/questions/74949299/how-to-versioning-releases-in-github-actions
# https://stackoverflow.com/questions/66017161/add-a-tag-to-a-docker-image-if-theres-a-git-tag-using-github-action
# To generate the docker labels/tags --> https://github.com/docker/metadata-action
name: Tag Docker Image like the chart AppVersion
on:
workflow_dispatch:
push:
branches:
- main
jobs:
test-next-release:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[to_release]')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: snowdrop/godaddy-webhook
fetch-depth: 0 # required for github-action-get-previous-tag
- uses: azure/setup-helm@v3
- # This action get the latest tag version and increment it
# using semver as documented: https://github.com/reecetech/version-increment/tree/main
name: Get next version
uses: reecetech/[email protected]
id: next-version
with:
scheme: semver
increment: minor
- name: Tag chart and image
if: contains(github.event.head_commit.message, '[to_release]')
run: |
export NEW_VERSION="${{ steps.next-version.outputs.version }}"
echo "New version: $NEW_VERSION"
yq '.appVersion = env(NEW_VERSION)' -i ./deploy/charts/godaddy-webhook/Chart.yaml
yq '.image.tag = env(NEW_VERSION)' -i ./deploy/charts/godaddy-webhook/values.yaml
echo "Chart updated"
cat ./deploy/charts/godaddy-webhook/Chart.yaml
echo "Values updated"
cat ./deploy/charts/godaddy-webhook/values.yaml
- name: Create release
id: create_release_id
#run: |
# echo "${{ steps.next-version.outputs.version }}"
# echo "${{ steps.next-version.outputs.v_version }}"
# echo "${{ steps.next-version.outputs.major_version }}"
# echo "${{ steps.next-version.outputs.minor_version }}"
# echo "${{ steps.next-version.outputs.patch_version }}"
# echo "${{ steps.next-version.outputs.major_v_version }}"
# echo "${{ steps.next-version.outputs.minor_v_version }}"
# echo "${{ steps.next-version.outputs.patch_v_version }}"
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.next-version.outputs.version }}
release_name: Release ${{ steps.next-version.outputs.version }}