-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (47 loc) · 1.22 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
---
stages:
- test
- release
.go_template_defaults:
stage: test
.semver_template_defaults:
stage: release
include:
- project: fsrvcorp/templates
file: templates/language/go.yml
ref: 1.0.10
- project: fsrvcorp/templates
file: templates/release/semver.yml
ref: 1.0.10
packages:
stage: release
image: goreleaser/goreleaser@sha256:8a70dbaf65cef49cd3ae9b564395fe875fa8136a3d45908f84c6e35ff8925ec9
script:
- git reset --hard $CI_COMMIT_SHA
- git clean -ffdx
- |
if [ -n "$CI_COMMIT_TAG" ]; then
goreleaser release --skip publish --clean
else
goreleaser release --skip publish --clean --snapshot
fi
artifacts:
paths:
- dist/*.deb
deb mirror:
stage: release
image: alpine@sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45
only:
- tags
dependencies:
- packages
needs:
- packages
before_script:
- apk add --no-cache ca-certificates curl
script:
- |
for file in dist/*.deb; do
URL="$(curl --upload-file ${file} https://t.fsrv.xyz)"
curl -X POST --fail -F token=$CI_JOB_TOKEN -F "variables[PACKAGE_URL]=${URL}" -F ref=main https://ref.ci/api/v4/projects/185/trigger/pipeline
done