This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
113 lines (100 loc) · 3.49 KB
/
release.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
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
name: Create Release
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Unit tests
uses: ./.github/actions/unit-tests
release:
needs: test
name: Release
uses: keptn/gh-automation/.github/workflows/[email protected]
docker_build:
needs: [release]
name: Docker Build
runs-on: ubuntu-20.04
env:
VERSION: ${{ needs.release.outputs.RELEASE_TAG }}
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Load CI Environment from .ci_env
id: load_ci_env
uses: c-py/action-dotenv-to-setenv@v4
with:
env-file: .ci_env
- name: Docker Build
id: docker_build_service
uses: keptn/gh-automation/.github/actions/[email protected]
with:
TAGS: |
${{ env.DOCKER_ORGANIZATION }}/${{ env.IMAGE }}:${{ env.VERSION }}
${{ env.DOCKER_ORGANIZATION }}/${{ env.IMAGE }}:${{ env.VERSION }}.${{ env.DATETIME }}
BUILD_ARGS: |
version=${{ env.VERSION }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
- name: Docker Build Initcontainer
id: docker_build_initcontainer
uses: keptn/gh-automation/.github/actions/[email protected]
with:
TAGS: |
${{ env.DOCKER_ORGANIZATION }}/${{ env.IMAGE_INITCONTAINER }}:${{ env.VERSION }}
${{ env.DOCKER_ORGANIZATION }}/${{ env.IMAGE_INITCONTAINER }}:${{ env.VERSION }}.${{ env.DATETIME }}
BUILD_ARGS: |
version=${{ env.VERSION }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
DOCKERFILE: ${{ env.DOCKERFILE_INITCONTAINER }}
helm_chart_build:
needs: [release, docker_build]
name: Build Helm Charts
runs-on: ubuntu-20.04
env:
VERSION: ${{ needs.release.outputs.RELEASE_TAG }}
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Load CI Environment from .ci_env
id: load_ci_env
uses: c-py/action-dotenv-to-setenv@v4
with:
env-file: .ci_env
- name: Build Helm Charts
id: build_helm_charts
uses: keptn/gh-automation/.github/actions/[email protected]
with:
VERSION: ${{ env.VERSION }}
APP_VERSION: ${{ env.VERSION }}
CHART_NAME: ${{ env.IMAGE }}
- name: Upload Helm Chart as release asset
env:
RELEASE_TAG: ${{ needs.release.outputs.RELEASE_TAG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_TAG" installer/*.tgz
linter_build:
needs: [release]
name: Build Linter
runs-on: ubuntu-20.04
env:
VERSION: ${{ needs.release.outputs.RELEASE_TAG }}
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Run make
run: make build-lint
- name: Rename binaries
run: |
mv ./bin/job-lint-linux-amd64 ./bin/job-lint-linux-amd64-$VERSION
mv ./bin/job-lint-windows-amd64 ./bin/job-lint-windows-amd64-$VERSION.exe
mv ./bin/job-lint-darwin-amd64 ./bin/job-lint-darwin-amd64-$VERSION
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$VERSION" bin/job-lint-*