summaryrefslogtreecommitdiff
path: root/platform/node/bitrise.yml
blob: 998e97301bfe60c8743f57da66ea3cfd01a23724 (plain)
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
format_version: 1.3.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

trigger_map:
- tag: "node-v*"
  workflow: primary
- push_branch: "*"
  workflow: primary
- pull_request_target_branch: "*"
  workflow: primary

workflows:
  primary:
    steps:
    - script:
        title: Check for skipping CI
        inputs:
        - content: |-
            #!/bin/bash
            if [[ -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[skip ci\]/p')"  ||
                  -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[ci skip\]/p')"  ||
                  -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY    | sed -n 's/\[skip ci\]/p')" ||
                  -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY    | sed -n 's/\[ci skip\]/p')" ]]; then
                envman add --key SKIPCI --value true
            else
                envman add --key SKIPCI --value false
            fi
    - script:
        title: Check for publishing
        run_if: '{{enveq "SKIPCI" "false"}}'
        inputs:
        - content: |-
            #!/bin/bash
            PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
            if [[ "${BITRISE_GIT_TAG:-}" == "node-v${PACKAGE_JSON_VERSION}" ]]; then
                envman add --key PUBLISH --value true
            fi
    - script:
        title: Run build script
        run_if: '{{enveq "SKIPCI" "false"}}'
        inputs:
        - content: |-
            #!/bin/bash
            set -eu -o pipefail
            brew update
            brew install cmake
            brew unlink node
            brew install awscli node@4
            brew link node@4
            gem install xcpretty --no-rdoc --no-ri
            make node
    - script:
        title: Run test script
        run_if: '{{and (enveq "SKIPCI" "false") (enveq "PUBLISH" "")}}'
        inputs:
        - content: |-
            #!/bin/bash
            set -eu -o pipefail
            make test-node || envman add --key RESULT --value $?
    - script:
        title: Run publish script
        run_if: '{{enveq "SKIPCI" "false"}}'
        inputs:
        - content: |-
            #!/bin/bash
            set -eu -o pipefail
            ./platform/node/scripts/after_script.sh ${BITRISE_BUILD_NUMBER}
            exit ${RESULT:-0}
    - slack:
        title: Post to Slack
        run_if: '{{enveq "SKIPCI" "false"}}'
        inputs:
        - webhook_url: "$SLACK_HOOK_URL"
        - channel: "#gl-bots"
        - from_username: 'Bitrise Node macOS'
        - from_username_on_error: 'Bitrise Node macOS'
        - message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
            for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
            by ${GIT_CLONE_COMMIT_COMMITER_NAME}
            passed'
        - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}>
            for <https://github.com/mapbox/mapbox-gl-native/compare/${BITRISE_GIT_BRANCH}|mapbox/mapbox-gl-native@${BITRISE_GIT_BRANCH}>
            by ${GIT_CLONE_COMMIT_COMMITER_NAME}
            failed'
        - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
        - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png