-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.gitlab-ci.yml
113 lines (105 loc) · 3.96 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
stages:
- build
- upload
- deploy
variables:
PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/binaries/"
build-linux:
stage: build
tags:
- linux
only:
- tags
image: node:fermium-slim
artifacts:
untracked: false
expire_in: 30 days
paths:
- "target/*.AppImage"
- "target/*.tar.gz"
- "target/*.deb"
- "target/latest-linux.yml"
before_script:
- apt update
- apt install -y build-essential python3 pkg-config libsecret-1-0 libsecret-1-dev ca-certificates openssh-client dpkg-dev dpkg-sig
- export RELEASE_VERSION=$(echo "${CI_COMMIT_TAG}" | sed 's/v//')
- yarn
- npm config set git-tag-version false
- npm version $RELEASE_VERSION
script:
- yarn build-production
- yarn package-linux
build-mac:
stage: build
tags:
- macos
only:
- tags
artifacts:
untracked: false
expire_in: 30 days
paths:
- "target/*.dmg"
- "target/latest-mac.yml"
before_script:
- source ~/.zshrc
- security unlock-keychain -p "$APPLE_CI_HOST_PASSWORD"
- export RELEASE_VERSION=$(echo "${CI_COMMIT_TAG}" | sed 's/v//')
- yarn
- npm config set git-tag-version false
- npm version $RELEASE_VERSION
script:
- yarn build-production
- yarn package-mac-unsigned
build-windows:
stage: build
image: electronuserland/builder:14-wine
tags:
- docker
only:
- tags
artifacts:
untracked: false
expire_in: 30 days
paths:
- "target/*.exe"
- "target/*.appx"
- "target/latest*.yml"
before_script:
- export RELEASE_VERSION=$(echo "${CI_COMMIT_TAG}" | sed 's/v//')
- yarn
- npm config set git-tag-version false
- npm version $RELEASE_VERSION
script:
- yarn build-production
- yarn package-windows
upload:
stage: upload
only:
- tags
image: curlimages/curl:latest
before_script:
- export RELEASE_VERSION=$(echo "${CI_COMMIT_TAG}" | sed 's/v//')
script:
- 'cd target && find . -maxdepth 1 -type f | while read -r line; do curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "${line}" "${PACKAGE_URL}${RELEASE_VERSION}/${result}"; done'
release:
stage: deploy
only:
- tags
when: manual
image: registry.gitlab.com/gitlab-org/release-cli:latest
before_script:
- export RELEASE_VERSION=$(echo "${CI_COMMIT_TAG}" | sed 's/v//')
script:
- |
release-cli create --name $CI_COMMIT_TAG --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"dmg\",\"filepath\":\"/dmg\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.dmg\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"exe\",\"filepath\":\"/exe\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.exe\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"nsis\",\"filepath\":\"/nsis\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr_Setup.exe\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"appx\",\"filepath\":\"/appx\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.appx\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"tar\",\"filepath\":\"/tar\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.tar.gz\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"deb\",\"filepath\":\"/deb\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.deb\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"appimage\",\"filepath\":\"/appimage\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/Cattr.AppImage\", \"link_type\":\"package\"}" \
--assets-link "{\"name\":\"windows-yml\",\"filepath\":\"/latest.yml\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/latest.yml\", \"link_type\":\"other\"}" \
--assets-link "{\"name\":\"mac-yml\",\"filepath\":\"/latest-mac.yml\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/latest-mac.yml\", \"link_type\":\"other\"}" \
--assets-link "{\"name\":\"linux-yml\",\"filepath\":\"/latest-linux.yml\",\"url\":\"${PACKAGE_URL}${RELEASE_VERSION}/latest-linux.yml\", \"link_type\":\"other\"}"