-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathpublish.yml
More file actions
54 lines (52 loc) · 1.83 KB
/
publish.yml
File metadata and controls
54 lines (52 loc) · 1.83 KB
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
labels:
type: exec
platform: linux/amd64
steps:
- name: publish-charts
image: bash
commands:
- export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
- export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\")
- export APP_VERSION=$([ -z $CI_COMMIT_TAG ] && echo $CI_COMMIT_SHA || echo $VERSION)
- export CHART_VERSION=$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
- sed -i s#{{repository}}#oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)#g charts/$${CI_REPO_NAME}/Chart.yaml
- helm dependency update charts/$${CI_REPO_NAME}
- helm package -u charts/$${CI_REPO_NAME} --version $CHART_VERSION --app-version $APP_VERSION
- echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
- helm push $${CI_REPO_NAME}-$CHART_VERSION.tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
- bash _scripts/generate_cache.sh
environment:
DRYCC_REGISTRY:
from_secret: drycc_registry
CONTAINER_USERNAME:
from_secret: container_username
CONTAINER_PASSWORD:
from_secret: container_password
when:
event:
- tag
- push
- cron
- name: publish-scripts
image: bash
commands:
- podman run --rm
-e CI_FORGE_TYPE=github
-e CI_PIPELINE_EVENT=tag
-e CI_REPO_OWNER="$CI_REPO_OWNER"
-e CI_REPO_NAME="$CI_REPO_NAME"
-e CI_COMMIT_REF="refs/tags/$CI_COMMIT_TAG"
-e PLUGIN_API_KEY="$GITHUB_TOKEN"
-e PLUGIN_BASE_URL="https://api.github.com/"
-e PLUGIN_UPLOAD_URL="https://uploads.github.com/"
-e PLUGIN_OVERWRITE="true"
-e PLUGIN_FILES="*.sh"
-v $(pwd):$(pwd)
-w $(pwd)
docker.io/woodpeckerci/plugin-release
environment:
GITHUB_TOKEN:
from_secret: github_token
when:
event:
- tag