11name : Publish
22on :
3- push :
4- # on:
5- # release:
6- # types: [published]
3+ release :
4+ types : [published]
75
86jobs :
97 publish :
108 runs-on : ubuntu-latest
11- # outputs:
12- # release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
9+ outputs :
10+ release_number : ${{steps.get_latest_release_number.outputs.release_tag}}
1311 permissions :
1412 contents : write
1513 pull-requests : write
@@ -34,15 +32,15 @@ jobs:
3432 sudo pip install twine
3533 working-directory : xero-python
3634
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-python
44- # env:
45- # GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
35+ - name : Fetch Latest release number
36+ id : get_latest_release_number
37+ run : |
38+ latest_version=$(gh release view --json tagName --jq '.tagName')
39+ echo "Latest release version is - $latest_version"
40+ echo "::set-output name=release_tag::$latest_version"
41+ working-directory : xero-python
42+ env :
43+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
4644
4745 - name : Build Package
4846 run : python setup.py sdist
@@ -55,52 +53,52 @@ jobs:
5553 run : twine upload dist/*
5654 working-directory : xero-python
5755
58- # notify-slack-on-success:
59- # runs-on: ubuntu-latest
60- # needs: publish
61- # if: success()
62- # permissions:
63- # contents: read
64- # steps:
65- # - name: Checkout xero-pythonrepo
66- # uses: actions/checkout@v4
67- # with:
68- # repository: XeroAPI/xero-python
69- # path: xero-python
56+ notify-slack-on-success :
57+ runs-on : ubuntu-latest
58+ needs : publish
59+ if : success()
60+ permissions :
61+ contents : read
62+ steps :
63+ - name : Checkout xero-pythonrepo
64+ uses : actions/checkout@v4
65+ with :
66+ repository : XeroAPI/xero-python
67+ path : xero-python
7068
71- # - name: Send slack notification on success
72- # uses: ./xero-python/.github/actions/notify-slack
73- # with:
74- # heading_text: "Publish job has succeeded !"
75- # alert_type: "thumbsup"
76- # job_status: "Success"
77- # XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
78- # job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
79- # button_type: "primary"
80- # package_version: ${{needs.publish.outputs.release_number}}
81- # repo_link: ${{github.server_url}}/${{github.repository}}
69+ - name : Send slack notification on success
70+ uses : ./xero-python/.github/actions/notify-slack
71+ with :
72+ heading_text : " Publish job has succeeded !"
73+ alert_type : " thumbsup"
74+ job_status : " Success"
75+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
76+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
77+ button_type : " primary"
78+ package_version : ${{needs.publish.outputs.release_number}}
79+ repo_link : ${{github.server_url}}/${{github.repository}}
8280
83- # notify-slack-on-failure:
84- # runs-on: ubuntu-latest
85- # needs: publish
86- # if: failure()
87- # permissions:
88- # contents: read
89- # steps:
90- # - name: Checkout xero-python repo
91- # uses: actions/checkout@v4
92- # with:
93- # repository: XeroAPI/xero-python
94- # path: xero-python
81+ notify-slack-on-failure :
82+ runs-on : ubuntu-latest
83+ needs : publish
84+ if : failure()
85+ permissions :
86+ contents : read
87+ steps :
88+ - name : Checkout xero-python repo
89+ uses : actions/checkout@v4
90+ with :
91+ repository : XeroAPI/xero-python
92+ path : xero-python
9593
96- # - name: Send slack notification on failure
97- # uses: ./xero-python/.github/actions/notify-slack
98- # with:
99- # heading_text: "Publish job has failed !"
100- # alert_type: "alert"
101- # job_status: "Failed"
102- # XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
103- # job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
104- # button_type: "danger"
105- # package_version: ${{needs.publish.outputs.release_number}}
106- # repo_link: ${{github.server_url}}/${{github.repository}}
94+ - name : Send slack notification on failure
95+ uses : ./xero-python/.github/actions/notify-slack
96+ with :
97+ heading_text : " Publish job has failed !"
98+ alert_type : " alert"
99+ job_status : " Failed"
100+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
101+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
102+ button_type : " danger"
103+ package_version : ${{needs.publish.outputs.release_number}}
104+ repo_link : ${{github.server_url}}/${{github.repository}}
0 commit comments