-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
58 lines (53 loc) · 1.64 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
stages:
- build
- upload
- release
variables:
GIT_SUBMODULE_STRATEGY: recursive
PACKAGE_VERSION: "${CI_COMMIT_TAG}"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/builds/${PACKAGE_VERSION}"
build-job:
stage: build
image: registry.gitlab.com/alexramallo/lugaruvita:latest
rules:
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
script:
- cd sdl2-vitagl-lugaru && mkdir -p build && cd build
- cmake .. -DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DVIDEO_VITA_VGL=TRUE -DVIDEO_VITA_PVR=FALSE
- make install -j`nproc`
- cd ../../
- python3 ./waf configure_release
- python3 ./waf build_release --tex-quality=pvrtcbest
- mv build/release/Lugaru.vpk ./Lugaru.vpk
artifacts:
name: "VPK"
paths:
- Lugaru.vpk
upload-job:
stage: upload
rules:
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
image: alpine:latest
needs:
- job: build-job
artifacts: true
script:
- |
apk add curl
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file Lugaru.vpk "${PACKAGE_REGISTRY_URL}/Lugaru-${PACKAGE_VERSION}.vpk"
release-job:
stage: release
rules:
- if: '$CI_COMMIT_TAG =~ /^release-.*$/'
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Creating release for '$CI_COMMIT_TAG'"
release:
name: "Release '$CI_COMMIT_TAG'"
description: "Created using release-cli"
tag_name: "$CI_COMMIT_SHORT_SHA"
ref: "$CI_COMMIT_TAG"
assets:
links:
- name: 'Lugaru VPK ($CI_COMMIT_SHORT_SHA)'
url: '${PACKAGE_REGISTRY_URL}/Lugaru-${PACKAGE_VERSION}.vpk'