10
10
jobs :
11
11
publish :
12
12
runs-on : ubuntu-latest
13
- environment : protected-env
14
13
outputs :
15
14
release_number : ${{steps.get_latest_release_number.outputs.release_tag}}
16
15
permissions :
@@ -23,37 +22,37 @@ jobs:
23
22
repository : XeroAPI/xero-node
24
23
path : xero-node
25
24
26
- # - name: Set up Node environment
27
- # uses: actions/setup-node@v4
28
- # with:
29
- # node-version: 20
30
- # cache: 'npm'
31
- # cache-dependency-path: '**/package-lock.json'
32
- # registry-url: 'https://registry.npmjs.org'
25
+ - name : Set up Node environment
26
+ uses : actions/setup-node@v4
27
+ with :
28
+ node-version : 20
29
+ cache : ' npm'
30
+ cache-dependency-path : ' **/package-lock.json'
31
+ registry-url : ' https://registry.npmjs.org'
33
32
34
- # - name: Install dependencies
35
- # run: npm ci
36
- # working-directory: xero-node
33
+ - name : Install dependencies
34
+ run : npm ci
35
+ working-directory : xero-node
37
36
38
- # - name: Run Build
39
- # run: npm run build
40
- # working-directory: xero-node
37
+ - name : Run Build
38
+ run : npm run build
39
+ working-directory : xero-node
41
40
42
- # - name: Fetch Latest release number
43
- # id: get_latest_release_number
44
- # run: |
45
- # latest_version=$(gh release view --json tagName --jq '.tagName')
46
- # echo "Latest release version is - $latest_version"
47
- # echo "::set-output name=release_tag::$latest_version"
48
- # working-directory: xero-node
49
- # env:
50
- # GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
41
+ - name : Fetch Latest release number
42
+ id : get_latest_release_number
43
+ run : |
44
+ latest_version=$(gh release view --json tagName --jq '.tagName')
45
+ echo "Latest release version is - $latest_version"
46
+ echo "::set-output name=release_tag::$latest_version"
47
+ working-directory : xero-node
48
+ env :
49
+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
51
50
52
- # - name: Publish to npm
53
- # env:
54
- # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55
- # run: npm publish
56
- # working-directory: xero-node
51
+ - name : Publish to npm
52
+ env :
53
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
54
+ run : npm publish
55
+ working-directory : xero-node
57
56
58
57
notify-codegen-repo :
59
58
needs : publish
65
64
steps :
66
65
- name : Checkout
67
66
uses : actions/checkout@v4
68
- # with:
69
- # repository: XeroAPI/xero-node
70
- # path: xero-node
67
+ with :
68
+ repository : XeroAPI/xero-node
69
+ path : xero-node
71
70
72
71
- name : Install octokit dependencies
73
72
run : npm i
@@ -105,52 +104,52 @@ jobs:
105
104
}
106
105
}'
107
106
108
- # notify-slack-on-success:
109
- # runs-on: ubuntu-latest
110
- # needs: publish
111
- # permissions:
112
- # contents: read
113
- # if: success()
114
- # steps:
115
- # - name: Checkout xero-node repo
116
- # uses: actions/checkout@v4
117
- # with:
118
- # repository: XeroAPI/xero-node
119
- # path: xero-node
107
+ notify-slack-on-success :
108
+ runs-on : ubuntu-latest
109
+ needs : publish
110
+ permissions :
111
+ contents : read
112
+ if : success()
113
+ steps :
114
+ - name : Checkout xero-node repo
115
+ uses : actions/checkout@v4
116
+ with :
117
+ repository : XeroAPI/xero-node
118
+ path : xero-node
120
119
121
- # - name: Send slack notification on success
122
- # uses: ./xero-node/.github/actions/notify-slack
123
- # with:
124
- # heading_text: "Publish job has succeeded !"
125
- # alert_type: "thumbsup"
126
- # job_status: "Success"
127
- # XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
128
- # job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
129
- # button_type: "primary"
130
- # package_version: ${{needs.publish.outputs.release_number}}
131
- # repo_link: ${{github.server_url}}/${{github.repository}}
120
+ - name : Send slack notification on success
121
+ uses : ./xero-node/.github/actions/notify-slack
122
+ with :
123
+ heading_text : " Publish job has succeeded !"
124
+ alert_type : " thumbsup"
125
+ job_status : " Success"
126
+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
127
+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
128
+ button_type : " primary"
129
+ package_version : ${{needs.publish.outputs.release_number}}
130
+ repo_link : ${{github.server_url}}/${{github.repository}}
132
131
133
- # notify-slack-on-failure:
134
- # runs-on: ubuntu-latest
135
- # needs: publish
136
- # permissions:
137
- # contents: read
138
- # if: failure()
139
- # steps:
140
- # - name: Checkout xero-node repo
141
- # uses: actions/checkout@v4
142
- # with:
143
- # repository: XeroAPI/xero-node
144
- # path: xero-node
132
+ notify-slack-on-failure :
133
+ runs-on : ubuntu-latest
134
+ needs : publish
135
+ permissions :
136
+ contents : read
137
+ if : failure()
138
+ steps :
139
+ - name : Checkout xero-node repo
140
+ uses : actions/checkout@v4
141
+ with :
142
+ repository : XeroAPI/xero-node
143
+ path : xero-node
145
144
146
- # - name: Send slack notification on failure
147
- # uses: ./xero-node/.github/actions/notify-slack
148
- # with:
149
- # heading_text: "Publish job has failed !"
150
- # alert_type: "alert"
151
- # job_status: "Failed"
152
- # XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
153
- # job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
154
- # button_type: "danger"
155
- # package_version: ${{needs.publish.outputs.release_number}}
156
- # repo_link: ${{github.server_url}}/${{github.repository}}
145
+ - name : Send slack notification on failure
146
+ uses : ./xero-node/.github/actions/notify-slack
147
+ with :
148
+ heading_text : " Publish job has failed !"
149
+ alert_type : " alert"
150
+ job_status : " Failed"
151
+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
152
+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
153
+ button_type : " danger"
154
+ package_version : ${{needs.publish.outputs.release_number}}
155
+ repo_link : ${{github.server_url}}/${{github.repository}}
0 commit comments