Skip to content

Commit 1d53d58

Browse files
author
sangeet-joy_xero
committed
clean uop
1 parent 020db25 commit 1d53d58

File tree

1 file changed

+76
-77
lines changed

1 file changed

+76
-77
lines changed

.github/workflows/publish.yml

Lines changed: 76 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
jobs:
1111
publish:
1212
runs-on: ubuntu-latest
13-
environment: protected-env
1413
outputs:
1514
release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
1615
permissions:
@@ -23,37 +22,37 @@ jobs:
2322
repository: XeroAPI/xero-node
2423
path: xero-node
2524

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

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
3736

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
4140

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

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
5756

5857
notify-codegen-repo:
5958
needs: publish
@@ -65,9 +64,9 @@ jobs:
6564
steps:
6665
- name: Checkout
6766
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
7170

7271
- name: Install octokit dependencies
7372
run: npm i
@@ -105,52 +104,52 @@ jobs:
105104
}
106105
}'
107106
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
120119

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

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
145144

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

Comments
 (0)