-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
55 lines (51 loc) · 1.35 KB
/
.gitlab-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
stages:
- zip
- upload
- release
variables:
PLASMOID_PKG: "plasmavantage-${CI_COMMIT_TAG}.plasmoid"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/plasmavantage/${CI_COMMIT_TAG}"
zip_job:
stage: zip
image: debian:latest
rules:
- if: $CI_COMMIT_TAG
artifacts:
paths:
- package/${PLASMOID_PKG}
before_script:
- apt-get update
- apt-get install -q -y --no-install-recommends zip
script:
- echo "Creating Plasmoid package..."
- cd package
- zip -r ${PLASMOID_PKG} metadata.json assets/ contents/
upload_job:
needs:
- job: zip_job
artifacts: true
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Uploading package to registry..."
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package/${PLASMOID_PKG} "${PACKAGE_REGISTRY_URL}/${PLASMOID_PKG}"
release_job:
needs:
- job: upload_job
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Performing release job..."
release:
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG_MESSAGE'
assets:
links:
- name: 'Plasmoid package (${CI_COMMIT_TAG})'
url: '${PACKAGE_REGISTRY_URL}/${PLASMOID_PKG}'
link_type: "package"