-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
115 lines (104 loc) · 3.39 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
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
image: "debian:bookworm-slim"
before_script:
- apt-get update -y
- apt-get install -y make git python3-pip python3-venv python3-yaml texlive-metapost libharfbuzz-bin
- python3 -m venv .venv
- source .venv/bin/activate
- pip3 install -r requirements.txt
stages:
- build
- test
- deploy
- release
variables:
PACKAGE_VERSION: $CI_COMMIT_TAG
MALINI_VAR_OTF: "Malini-VF.otf"
MALINI_VAR_TTF: "Malini-VF.ttf"
MALINI_VAR_WOFF2: "Malini-VF.woff2"
MALINI_ZIP: "Malini-${PACKAGE_VERSION}.zip"
MALINI_TAR_BALL: "Malini-${PACKAGE_VERSION}.tar.gz"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/fontrelease/${PACKAGE_VERSION}"
build:
stage: build
script:
- make build release
artifacts:
paths:
- fonts
test:
stage: test
script:
- ruff check .
- make test
artifacts:
expire_in: 1000 yrs
paths:
- proofs
pages:
stage: deploy
before_script:
- echo "Pass. Just overriding"
script:
- mkdir public
- cp -rf fonts tests specimen proofs public
artifacts:
expire_in: 1000 yrs
paths:
- public # instruct GitLab to keep the public folder
only:
- master
upload:
stage: release
image: curlimages/curl:latest
dependencies:
- build
rules:
- if: $CI_COMMIT_TAG
before_script:
- echo "Pass. Just overriding"
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fonts/Malini/otf-variable/${MALINI_VAR_OTF} ${PACKAGE_REGISTRY_URL}/${MALINI_VAR_OTF}
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fonts/Malini/ttf-variable/${MALINI_VAR_TTF} ${PACKAGE_REGISTRY_URL}/${MALINI_VAR_TTF}
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fonts/Malini/webfonts/${MALINI_VAR_WOFF2} ${PACKAGE_REGISTRY_URL}/${MALINI_VAR_WOFF2}
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fonts/${MALINI_ZIP} ${PACKAGE_REGISTRY_URL}/${MALINI_ZIP}
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fonts/${MALINI_TAR_BALL} ${PACKAGE_REGISTRY_URL}/${MALINI_TAR_BALL}
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs: ["upload"]
only:
- tags
before_script:
- echo "Pass. Just overriding"
script:
- echo "Running release_job for $CI_COMMIT_TAG of $CI_PROJECT_NAME"
release:
name: 'Release $CI_COMMIT_TAG of $CI_PROJECT_NAME'
description: 'Release $CI_COMMIT_TAG' # Need to replace with 'CHANGELOG.md'
# tag_name is a mandatory field and can not be an empty string
tag_name: '$CI_COMMIT_TAG'
ref: $CI_COMMIT_TAG
assets:
links:
- name: 'Malini Variable font TTF version - Recommended for desktop installations'
url: '${PACKAGE_REGISTRY_URL}/${MALINI_VAR_TTF}'
- name: 'Malini Variable font OTF version - Recommended for desktop installations with latest operating systems'
url: '${PACKAGE_REGISTRY_URL}/${MALINI_VAR_OTF}'
- name: 'Malini Variable font webfont - For font embedding in webpages.'
url: '${PACKAGE_REGISTRY_URL}/${MALINI_VAR_WOFF2}'
- name: 'Malini all font variants as tar.gz'
url: '${PACKAGE_REGISTRY_URL}/${MALINI_TAR_BALL}'
- name: 'Malini all font variants as zip file'
url: '${PACKAGE_REGISTRY_URL}/${MALINI_ZIP}'
trigger_job:
stage: release
needs: ["release"]
only:
- tags
trigger:
project: smc/smc.org.in