-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
67 lines (64 loc) · 1.92 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
stages:
- test
- build
- release
test-job:
stage: test
tags:
- macos
script:
- xcodebuild clean test -project ACShell.xcodeproj -scheme ACShell
build-job:
stage: build
tags:
- macos
variables:
AC_JOB_ID: $CI_JOB_ID
AC_VERSION_ID: $CI_COMMIT_TAG.$CI_JOB_ID
AC_PROJECT_URL: $CI_PROJECT_URL
before_script:
- echo AC_JOB_ID=$AC_JOB_ID >> build.env
- echo AC_VERSION_ID=$AC_VERSION_ID >> build.env
- echo AC_PROJECT_URL=$AC_PROJECT_URL >> build.env
script:
- xcodebuild clean build -project ACShell.xcodeproj -scheme ACShell -configuration release -derivedDataPath ./DerivedData APPLICATION_VERSION_NUMBER=$CI_COMMIT_TAG APPLICATION_BUILD_NUMBER=$CI_BUILD_ID
- cd package_dmg && ./package.sh ACShell-Release-$CI_COMMIT_TAG.$CI_JOB_ID ../DerivedData/Build/Products/Release/ACShell.app ../CHANGELOG.md
artifacts:
paths:
- $CI_PROJECT_DIR/package_dmg/*.dmg
- $CI_PROJECT_DIR/CHANGELOG.md
reports:
dotenv: build.env
rules:
- if: $CI_COMMIT_TAG != null
when: always
- if: $CI_COMMIT_TAG == null
when: manual
release-job:
stage: release
tags:
- docker
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo 'running release_job'
- echo 'Releasing artefacts from build job:'
- echo $AC_JOB_ID
- echo $AC_VERSION_ID
needs:
- job: build-job
artifacts: true
release:
name: "ACShell $AC_VERSION_ID"
description: "Created using the release-cli"
tag_name: "$CI_COMMIT_TAG"
assets:
links:
- name: "ACShell-Release-$AC_VERSION_ID.dmg"
url: "$AC_PROJECT_URL/-/jobs/${AC_JOB_ID}/artifacts/file/package_dmg/ACShell-Release-$AC_VERSION_ID.dmg"
- name: "CHANGELOG.md"
url: "$AC_PROJECT_URL/-/jobs/${AC_JOB_ID}/artifacts/file/CHANGELOG.md"
rules:
- if: $CI_COMMIT_TAG != null
when: always
- if: $CI_COMMIT_TAG == null
when: manual