-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
40 lines (36 loc) · 1.21 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
stages:
- build
- upload
- release
before_script:
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/releases/$(echo ${CI_COMMIT_TAG} | sed 's/v//')"
build:
stage: build
image: golang:1.15
before_script:
- apt-get update
- apt-get install -y gcc-multilib gcc-mingw-w64
script:
- mkdir -p /go/src/gitlab.com/ChriZ98
- cp -r $CI_PROJECT_DIR /go/src/gitlab.com/ChriZ98/gog-galaxy-2-0-start-menu-tiles
- CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -o GOG_Galaxy_Start_Menu.exe
artifacts:
paths:
- GOG_Galaxy_Start_Menu.exe
upload:
stage: upload
image: curlimages/curl:latest
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file GOG_Galaxy_Start_Menu.exe ${PACKAGE_REGISTRY_URL}/GOG_Galaxy_Start_Menu.exe
only:
- tags
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- |
release-cli create --name "$CI_COMMIT_TAG - Release name" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"GOG_Galaxy_Start_Menu.exe\",\"url\":\"${PACKAGE_REGISTRY_URL}/GOG_Galaxy_Start_Menu.exe\"}"
only:
- tags