Skip to content

Commit ff8d1e0

Browse files
author
sangeet-joy_xero
committed
clean up
1 parent 2839468 commit ff8d1e0

1 file changed

Lines changed: 75 additions & 75 deletions

File tree

.github/workflows/publish.yml

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
publish:
1212
runs-on: ubuntu-latest
13-
# environment: protected-env
13+
environment: protected-env
1414
outputs:
1515
release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
1616
permissions:
@@ -23,37 +23,37 @@ jobs:
2323
repository: XeroAPI/xero-node
2424
path: xero-node
2525

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'
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'
3333

34-
# - name: Install dependencies
35-
# run: npm ci
36-
# working-directory: xero-node
34+
- name: Install dependencies
35+
run: npm ci
36+
working-directory: xero-node
3737

38-
# - name: Run Build
39-
# run: npm run build
40-
# working-directory: xero-node
38+
- name: Run Build
39+
run: npm run build
40+
working-directory: xero-node
4141

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}}
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}}
5151

52-
# - name: Publish to npm
53-
# env:
54-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55-
# run: npm publish
56-
# working-directory: xero-node
52+
- name: Publish to npm
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
run: npm publish
56+
working-directory: xero-node
5757

5858
notify-codegen-repo:
5959
needs: publish
@@ -100,58 +100,58 @@ jobs:
100100
"status": "${{needs.publish.result}}",
101101
"deployer": "xero-codegen-bot",
102102
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
103-
"environment": "test",
103+
"environment": "prod",
104104
"sdk_type": "node",
105105
"cab_key": "${{ github.event.inputs.cab_id }}"
106106
}
107107
}'
108108
109-
# notify-slack-on-success:
110-
# runs-on: ubuntu-latest
111-
# needs: publish
112-
# permissions:
113-
# contents: read
114-
# if: success()
115-
# steps:
116-
# - name: Checkout xero-node repo
117-
# uses: actions/checkout@v4
118-
# with:
119-
# repository: XeroAPI/xero-node
120-
# path: xero-node
109+
notify-slack-on-success:
110+
runs-on: ubuntu-latest
111+
needs: publish
112+
permissions:
113+
contents: read
114+
if: success()
115+
steps:
116+
- name: Checkout xero-node repo
117+
uses: actions/checkout@v4
118+
with:
119+
repository: XeroAPI/xero-node
120+
path: xero-node
121121

122-
# - name: Send slack notification on success
123-
# uses: ./xero-node/.github/actions/notify-slack
124-
# with:
125-
# heading_text: "Publish job has succeeded !"
126-
# alert_type: "thumbsup"
127-
# job_status: "Success"
128-
# XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
129-
# job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
130-
# button_type: "primary"
131-
# package_version: ${{needs.publish.outputs.release_number}}
132-
# repo_link: ${{github.server_url}}/${{github.repository}}
122+
- name: Send slack notification on success
123+
uses: ./xero-node/.github/actions/notify-slack
124+
with:
125+
heading_text: "Publish job has succeeded !"
126+
alert_type: "thumbsup"
127+
job_status: "Success"
128+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
129+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
130+
button_type: "primary"
131+
package_version: ${{needs.publish.outputs.release_number}}
132+
repo_link: ${{github.server_url}}/${{github.repository}}
133133

134-
# notify-slack-on-failure:
135-
# runs-on: ubuntu-latest
136-
# needs: publish
137-
# permissions:
138-
# contents: read
139-
# if: failure()
140-
# steps:
141-
# - name: Checkout xero-node repo
142-
# uses: actions/checkout@v4
143-
# with:
144-
# repository: XeroAPI/xero-node
145-
# path: xero-node
134+
notify-slack-on-failure:
135+
runs-on: ubuntu-latest
136+
needs: publish
137+
permissions:
138+
contents: read
139+
if: failure()
140+
steps:
141+
- name: Checkout xero-node repo
142+
uses: actions/checkout@v4
143+
with:
144+
repository: XeroAPI/xero-node
145+
path: xero-node
146146

147-
# - name: Send slack notification on failure
148-
# uses: ./xero-node/.github/actions/notify-slack
149-
# with:
150-
# heading_text: "Publish job has failed !"
151-
# alert_type: "alert"
152-
# job_status: "Failed"
153-
# XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
154-
# job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
155-
# button_type: "danger"
156-
# package_version: ${{needs.publish.outputs.release_number}}
157-
# repo_link: ${{github.server_url}}/${{github.repository}}
147+
- name: Send slack notification on failure
148+
uses: ./xero-node/.github/actions/notify-slack
149+
with:
150+
heading_text: "Publish job has failed !"
151+
alert_type: "alert"
152+
job_status: "Failed"
153+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
154+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
155+
button_type: "danger"
156+
package_version: ${{needs.publish.outputs.release_number}}
157+
repo_link: ${{github.server_url}}/${{github.repository}}

0 commit comments

Comments
 (0)