|
1 | 1 | name: Publish
|
2 |
| -# on: |
3 |
| -# release: |
4 |
| -# types: [published] |
5 | 2 | on:
|
6 |
| - push: |
| 3 | + release: |
| 4 | + types: [published] |
7 | 5 |
|
8 | 6 | jobs:
|
9 | 7 | publish:
|
@@ -36,68 +34,68 @@ jobs:
|
36 | 34 | run: npm run build
|
37 | 35 | working-directory: xero-node
|
38 | 36 |
|
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}} |
48 | 46 |
|
49 | 47 | - name: Publish to npm
|
50 | 48 | env:
|
51 | 49 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
52 | 50 | run: npm publish
|
53 | 51 | working-directory: xero-node
|
54 | 52 |
|
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 |
67 | 65 |
|
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}} |
79 | 77 |
|
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 |
92 | 90 |
|
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