-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (48 loc) · 1.26 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
# This file is a template, and might need editing before it works on your project.
# use the official gcc image, based on debian
# can use verions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/
variables:
PROJECT_NAME: hash_table
PACKAGE_REGISTRY_BASE_URL: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic"
ARCHIVE_URL: '$PACKAGE_REGISTRY_BASE_URL/dist/$CI_COMMIT_TAG/dist.tar.gz'
stages:
- test
- upload
- release
test_and_build:
stage: test
image: gcc
before_script:
- apt update && apt -y install make valgrind
script:
- make test
- make clean
- make package
artifacts:
paths:
- './$PROJECT_NAME-*.tar.gz'
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $PROJECT_NAME-*.tar.gz $ARCHIVE_URL
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Releasing $CI_COMMIT_TAG"
release:
name: 'Release $CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
description: '64bit release $CI_COMMIT_TAG'
assets:
links:
- name: dist.tar.gz
url: '$ARCHIVE_URL'