-
Notifications
You must be signed in to change notification settings - Fork 583
91 lines (89 loc) · 2.83 KB
/
ci-carvel.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
name: CI Carvel
on:
push:
branches:
- main
paths:
- 'src/carvel/**'
workflow_dispatch:
inputs:
branch:
description: 'Branch or tag to use to determine version numbers'
package_version:
description: 'Package version to publish. If blank will match dataflow version'
required: false
jobs:
# test templating before publishing a package
prepare:
name: Prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
- uses: actions/checkout@v2
with:
ref: ${{ inputs.branch && inputs.branch || github.ref }}
path: 'target'
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: carvel-dev/setup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup npm
shell: bash
working-directory: src/carvel
run: npm install
- name: npm ci
shell: bash
working-directory: src/carvel
run: npm ci
- name: Lint
shell: bash
working-directory: src/carvel
run: npm run format-check
- name: Test
shell: bash
working-directory: src/carvel
run: npm test
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/'
- name: Configure Env
run: |
ROOT=$(realpath $PWD)
pushd target
source $ROOT/.github/workflows/export-app-versions.sh
echo DATAFLOW_VERSION=$DATAFLOW_VERSION >> $GITHUB_ENV
echo SKIPPER_VERSION=$SKIPPER_VERSION >> $GITHUB_ENV
if [ "${{ inputs.package_version }}" != "" ]; then
echo PACKAGE_VERSION=${{ inputs.package_version }} >> $GITHUB_ENV
else
echo PACKAGE_VERSION=$DATAFLOW_VERSION >> $GITHUB_ENV
fi
popd
outputs:
dataflow-version: ${{ env.DATAFLOW_VERSION }}
skipper-version: ${{ env.SKIPPER_VERSION }}
package-version: ${{ env.PACKAGE_VERSION }}
publish:
name: Publish
needs:
- prepare
uses: ./.github/workflows/common-carvel.yml
with:
package-name: 'scdf'
package-version: ${{ needs.prepare.outputs.package-version }}
server-repository: 'springcloud/spring-cloud-dataflow-server'
skipper-repository: 'springcloud/spring-cloud-skipper-server'
package-bundle: 'springcloud/scdf-oss-package'
repository-bundle: 'springcloud/scdf-oss-repo'
dataflow-version: ${{ needs.prepare.outputs.dataflow-version }}
server-version: ${{ needs.prepare.outputs.dataflow-version }}
ctr-version: ${{ needs.prepare.outputs.dataflow-version }}
skipper-version: ${{ needs.prepare.outputs.skipper-version }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}