-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (104 loc) · 3.39 KB
/
ci.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
114
115
116
name: Build and Test
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize, labeled]
env:
GO_VERSION: 1.22.0
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', 'main') }}
jobs:
bump:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.CONDUKTORBOT_GHCR_RW }}
APP_VERSION: 0.2.1
APP_SHA: ${{ github.sha }}
steps:
- run: env
shell: bash
- uses: actions/checkout@v3
with:
repository: 'conduktor/homebrew-brew'
ref: ${{ github.ref_name }}
path: homebrew-brew
token: ${{ secrets.CONDUKTORBOT_REPO_WRITE }}
- name: Update conduktor-ctl on homebrew
run: |
yq --version
gh version
gh auth status
export BRANCH=update_console-plus_$APP_VERSION
echo BRANCH $BRANCH
export BASE_BRANCH=${{ github.ref_name }}
echo BASE_BRANCH $BASE_BRANCH
export TITLE="Bump conduktor-ctl version to ${APP_VERSION}"
export BODY="Release https://github.com/conduktor/ctl/releases/tag/${APP_VERSION}"
export MESSAGE="${TITLE} .${BODY}"
echo TITLE $TITLE
echo BODY $BODY
echo MESSAGE $MESSAGE
cd homebrew-brew
sed -i 's/version "[^"]*"/version "${APP_VERSION}"/' Formula/conduktor-cli.rb
sed -i 's/gitSha\s*=\s*"[^"]*"/gitSha = "${APP_SHA}"/' Formula/conduktor-cli.rb
git add Formula/conduktor-cli.rb
gh pr create --title "$TITLE" --body "$BODY" --repo 'https://github.com/conduktor/platform-build' --base $BASE_BRANCH
gh pr merge --auto --squash --delete-branch
cd ..
update_release_draft:
runs-on: ubuntu-latest
if: ${{ github.ref == format('refs/heads/{0}', 'main') }}
steps:
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: go test
run: go test ./...
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: run test
run: ./test_final_exec.sh
docker-test:
runs-on: ubuntu-latest
env:
IMAGE_NAME: "conduktor-ctl"
PLATFORMS: "linux/amd64,linux/arm64"
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- uses: docker/metadata-action@v4
id: docker_meta
with:
images: conduktor/${{ env.IMAGE_NAME }}
tags: type=sha
- name: Build ${{ env.IMAGE_NAME }}
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ env.PLATFORMS }}
push: false
file: docker/Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
hash=${{ github.sha }}
version=${{ github.ref_name }}