-
Notifications
You must be signed in to change notification settings - Fork 350
/
Copy pathaction.yml
156 lines (139 loc) · 5.93 KB
/
action.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
name: release-nightly
description: 'action used to release nightly'
inputs:
goVersionFile:
required: true
type: string
javaVersion:
required: true
type: string
# Make sure to treat the below values confidential (ie, not logging)
secretE2ECluster:
required: true
secretE2EKube:
required: true
secretDockerHubUser:
required: true
secretDockerHubPassword:
required: true
secretGithubToken:
required: true
runs:
using: "composite"
steps:
- name: Install newer docker CLI supporting multi platform build
shell: bash
run: |
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- name: Set up QEMU (required by multi platform build)
uses: docker/setup-qemu-action@v3
- name: Infra setting
uses: ./.github/actions/infra-setting
- name: Install operator
shell: bash
run: |
kubectl create ns camel-k
make install-k8s-global
kubectl wait --for=jsonpath='{.status.phase}'=Ready itp camel-k -n camel-k --timeout=60s
- name: Run test
shell: bash
run: |
DO_TEST_PREBUILD=false GOTESTFMT="-json 2>&1 | gotestfmt" make test-common
- name: Get nightly version and update date
shell: bash
run: |
V="$(make get-version | sed s/-SNAPSHOT//)-nightly"
D=$(date)
echo "VERSION=$V" >> $GITHUB_ENV
echo "UPD_DATE=$D" >> $GITHUB_ENV
IMAGE_NAME=docker.io/${TEST_DOCKER_HUB_USERNAME:-testcamelk}/camel-k
echo "Using IMAGE_NAME=$IMAGE_NAME"
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
- name: Login to staging container registry
uses: docker/login-action@v3
with:
username: ${{ inputs.secretDockerHubUser }}
password: ${{ inputs.secretDockerHubPassword }}
- name: Build and release containers
shell: bash
run: |
make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} bundle release-helm images-nightly release-nightly
- name: Build and push OLM bundle
shell: bash
run: |
make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} BUNDLE_IMAGE_NAME=docker.io/testcamelk/camel-k-bundle bundle-push
- name: Generate SBOM
uses: ./.github/actions/gh-go-mod-generate-sbom
with:
version: v1
args: mod -licenses -json -output sbom.json
- name: Commit and push nightly branch
shell: bash
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
CI_TOKEN: ${{ inputs.secretGithubToken }}
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add docs/charts/
git commit -am 'chore(ci): v${{ env.VERSION }} release updates' || echo "No nightly release updates changes to commit"
echo "COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV
git tag v${{ env.VERSION }} $(git rev-parse HEAD)
git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" tag v${{ env.VERSION }} -f || echo "No nightly release updates changes to push"
- name: Create Release
id: create_release
uses: ncipollo/release-action@1e3e9c6637e5566e185b7ab66f187539c5a76da7
with:
artifacts: "./camel-k-client*.tar.gz,sbom.json"
body: |
```
NOTE: last updated on ${{ env.UPD_DATE }}
```
Apache Camel K ${{ env.VERSION }} build for testing purposese only (unstable). This nightly release is using an **unsupported** operator image published as `${{ env.IMAGE_NAME }}:${{ env.VERSION }}`. The available platforms are AMD64 and ARM64.
## Kubectl
```
kubectl apply -k github.com/apache/camel-k/install/overlays/kubernetes/descoped?ref=v${{ env.VERSION }}
```
## Helm
```
helm install camel-k https://github.com/apache/camel-k/raw/v${{ env.VERSION }}/docs/charts/camel-k-${{ env.VERSION }}.tgz
```
## OLM
Use the `operator-sdk` tool and run the bundle via:
```
operator-sdk run bundle docker.io/testcamelk/camel-k-bundle:${{ env.VERSION }}
```
token: ${{ inputs.secretGithubToken }}
draft: false
prerelease: true
allowUpdates: true
replacesArtifacts: true
tag: v${{ env.VERSION }}
commit: ${{ env.COMMIT_ID }}