Skip to content

Commit 81cf6c9

Browse files
author
sangeet-joy_xero
committed
reverted back the changes
1 parent 7cca3b1 commit 81cf6c9

File tree

1 file changed

+57
-59
lines changed

1 file changed

+57
-59
lines changed

.github/workflows/publish.yml

+57-59
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Publish
2-
# on:
3-
# release:
4-
# types: [published]
52
on:
6-
push:
3+
release:
4+
types: [published]
75

86
jobs:
97
publish:
@@ -36,68 +34,68 @@ jobs:
3634
run: npm run build
3735
working-directory: xero-node
3836

39-
# - name: Fetch Latest release number
40-
# id: get_latest_release_number
41-
# run: |
42-
# latest_version=$(gh release view --json tagName --jq '.tagName')
43-
# echo "Latest release version is - $latest_version"
44-
# echo "::set-output name=release_tag::$latest_version"
45-
# working-directory: xero-node
46-
# env:
47-
# GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
37+
- name: Fetch Latest release number
38+
id: get_latest_release_number
39+
run: |
40+
latest_version=$(gh release view --json tagName --jq '.tagName')
41+
echo "Latest release version is - $latest_version"
42+
echo "::set-output name=release_tag::$latest_version"
43+
working-directory: xero-node
44+
env:
45+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4846

4947
- name: Publish to npm
5048
env:
5149
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5250
run: npm publish
5351
working-directory: xero-node
5452

55-
# notify-slack-on-success:
56-
# runs-on: ubuntu-latest
57-
# needs: publish
58-
# permissions:
59-
# contents: read
60-
# if: success()
61-
# steps:
62-
# - name: Checkout xero-node repo
63-
# uses: actions/checkout@v4
64-
# with:
65-
# repository: XeroAPI/xero-node
66-
# path: xero-node
53+
notify-slack-on-success:
54+
runs-on: ubuntu-latest
55+
needs: publish
56+
permissions:
57+
contents: read
58+
if: success()
59+
steps:
60+
- name: Checkout xero-node repo
61+
uses: actions/checkout@v4
62+
with:
63+
repository: XeroAPI/xero-node
64+
path: xero-node
6765

68-
# - name: Send slack notification on success
69-
# uses: ./xero-node/.github/actions/notify-slack
70-
# with:
71-
# heading_text: "Publish job has succeeded !"
72-
# alert_type: "thumbsup"
73-
# job_status: "Success"
74-
# XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
75-
# job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
76-
# button_type: "primary"
77-
# package_version: ${{needs.publish.outputs.release_number}}
78-
# repo_link: ${{github.server_url}}/${{github.repository}}
66+
- name: Send slack notification on success
67+
uses: ./xero-node/.github/actions/notify-slack
68+
with:
69+
heading_text: "Publish job has succeeded !"
70+
alert_type: "thumbsup"
71+
job_status: "Success"
72+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
73+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
74+
button_type: "primary"
75+
package_version: ${{needs.publish.outputs.release_number}}
76+
repo_link: ${{github.server_url}}/${{github.repository}}
7977

80-
# notify-slack-on-failure:
81-
# runs-on: ubuntu-latest
82-
# needs: publish
83-
# permissions:
84-
# contents: read
85-
# if: failure()
86-
# steps:
87-
# - name: Checkout xero-node repo
88-
# uses: actions/checkout@v4
89-
# with:
90-
# repository: XeroAPI/xero-node
91-
# path: xero-node
78+
notify-slack-on-failure:
79+
runs-on: ubuntu-latest
80+
needs: publish
81+
permissions:
82+
contents: read
83+
if: failure()
84+
steps:
85+
- name: Checkout xero-node repo
86+
uses: actions/checkout@v4
87+
with:
88+
repository: XeroAPI/xero-node
89+
path: xero-node
9290

93-
# - name: Send slack notification on failure
94-
# uses: ./xero-node/.github/actions/notify-slack
95-
# with:
96-
# heading_text: "Publish job has failed !"
97-
# alert_type: "alert"
98-
# job_status: "Failed"
99-
# XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
100-
# job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
101-
# button_type: "danger"
102-
# package_version: ${{needs.publish.outputs.release_number}}
103-
# repo_link: ${{github.server_url}}/${{github.repository}}
91+
- name: Send slack notification on failure
92+
uses: ./xero-node/.github/actions/notify-slack
93+
with:
94+
heading_text: "Publish job has failed !"
95+
alert_type: "alert"
96+
job_status: "Failed"
97+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
98+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
99+
button_type: "danger"
100+
package_version: ${{needs.publish.outputs.release_number}}
101+
repo_link: ${{github.server_url}}/${{github.repository}}

0 commit comments

Comments
 (0)