Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8dc73a720 | |||
| 27280e8d45 | |||
| 8c5e12960d | |||
| 849dc9b0ee |
@@ -1,11 +1,11 @@
|
|||||||
stages:
|
stages:
|
||||||
- build-docker
|
- build
|
||||||
- build-binary
|
- build
|
||||||
- upload
|
- upload
|
||||||
- release
|
- release
|
||||||
|
|
||||||
build-docker:
|
build docker:
|
||||||
stage: build-docker
|
stage: build
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
image: docker:19.03.12
|
image: docker:19.03.12
|
||||||
@@ -20,8 +20,10 @@ build-docker:
|
|||||||
- docker push $IMAGE_TAG
|
- docker push $IMAGE_TAG
|
||||||
- docker push $CI_REGISTRY_IMAGE:latest
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
|
|
||||||
build-binary:
|
build binary:
|
||||||
stage: build-binary
|
stage: build
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
image: golang:1.17.3
|
image: golang:1.17.3
|
||||||
before_script:
|
before_script:
|
||||||
- cd $GOPATH/src
|
- cd $GOPATH/src
|
||||||
@@ -30,17 +32,22 @@ build-binary:
|
|||||||
- ln -s $CI_PROJECT_DIR
|
- ln -s $CI_PROJECT_DIR
|
||||||
- cd $CI_PROJECT_NAME
|
- cd $CI_PROJECT_NAME
|
||||||
script:
|
script:
|
||||||
- CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -o iPilot-${CI_COMMIT_TAG}-darwin-amd64
|
- CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -o bin/iPilot-${CI_COMMIT_TAG}-darwin-amd64
|
||||||
- CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -o iPilot-${CI_COMMIT_TAG}-darwin-arm64
|
- CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -o bin/iPilot-${CI_COMMIT_TAG}-darwin-arm64
|
||||||
- CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o iPilot-${CI_COMMIT_TAG}-linux-amd64
|
- CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o bin/iPilot-${CI_COMMIT_TAG}-linux-amd64
|
||||||
- CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o iPilot-${CI_COMMIT_TAG}-win-amd64.exe
|
- CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o bin/iPilot-${CI_COMMIT_TAG}-win-amd64.exe
|
||||||
- CGO_ENABLED=0 GOARCH=386 GOOS=windows go build -o iPilot-${CI_COMMIT_TAG}-win-x86.exe
|
- CGO_ENABLED=0 GOARCH=386 GOOS=windows go build -o bin/iPilot-${CI_COMMIT_TAG}-win-x86.exe
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- bin/
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
stage: upload
|
stage: upload
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
dependencies:
|
||||||
|
- build:binary
|
||||||
script:
|
script:
|
||||||
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-amd64 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/iPilot/${CI_COMMIT_TAG}/iPilot-${CI_COMMIT_TAG}-darwin-amd64"'
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-amd64 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/iPilot/${CI_COMMIT_TAG}/iPilot-${CI_COMMIT_TAG}-darwin-amd64"'
|
||||||
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-arm64 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/iPilot/${CI_COMMIT_TAG}/iPilot-${CI_COMMIT_TAG}-darwin-arm64"'
|
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-arm64 "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/iPilot/${CI_COMMIT_TAG}/iPilot-${CI_COMMIT_TAG}-darwin-arm64"'
|
||||||
|
|||||||
Reference in New Issue
Block a user