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
@@ -20,15 +18,15 @@ jobs:
2018 repository : XeroAPI/xero-ruby
2119 path : xero-ruby
2220
23- # - name: Fetch Latest release number
24- # id: get_latest_release_number
25- # run: |
26- # latest_version=$(gh release view --json tagName --jq '.tagName')
27- # echo "Latest release version is - $latest_version"
28- # echo "::set-output name=release_tag::$latest_version"
29- # working-directory: xero-ruby
30- # env:
31- # GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
21+ - name : Fetch Latest release number
22+ id : get_latest_release_number
23+ run : |
24+ latest_version=$(gh release view --json tagName --jq '.tagName')
25+ echo "Latest release version is - $latest_version"
26+ echo "::set-output name=release_tag::$latest_version"
27+ working-directory : xero-ruby
28+ env :
29+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
3230
3331 - name : Set up Ruby environment
3432 uses : ruby/setup-ruby@v1
@@ -50,52 +48,52 @@ jobs:
5048 gem push "$gem_file"
5149 working-directory : xero-ruby
5250
53- # notify-slack-on-success:
54- # runs-on: ubuntu-latest
55- # needs: publish
56- # if: success()
57- # permissions:
58- # contents: read
59- # steps:
60- # - name: Checkout xero-ruby repo
61- # uses: actions/checkout@v4
62- # with:
63- # repository: XeroAPI/xero-ruby
64- # path: xero-ruby
51+ notify-slack-on-success :
52+ runs-on : ubuntu-latest
53+ needs : publish
54+ if : success()
55+ permissions :
56+ contents : read
57+ steps :
58+ - name : Checkout xero-ruby repo
59+ uses : actions/checkout@v4
60+ with :
61+ repository : XeroAPI/xero-ruby
62+ path : xero-ruby
6563
66- # - name: Send slack notification on success
67- # uses: ./xero-ruby/.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}}
64+ - name : Send slack notification on success
65+ uses : ./xero-ruby/.github/actions/notify-slack
66+ with :
67+ heading_text : " Publish job has succeeded !"
68+ alert_type : " thumbsup"
69+ job_status : " Success"
70+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
71+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
72+ button_type : " primary"
73+ package_version : ${{needs.publish.outputs.release_number}}
74+ repo_link : ${{github.server_url}}/${{github.repository}}
7775
78- # notify-slack-on-failure:
79- # runs-on: ubuntu-latest
80- # needs: publish
81- # if: failure()
82- # permissions:
83- # contents: read
84- # steps:
85- # - name: Checkout xero-ruby repo
86- # uses: actions/checkout@v4
87- # with:
88- # repository: XeroAPI/xero-ruby
89- # path: xero-ruby
76+ notify-slack-on-failure :
77+ runs-on : ubuntu-latest
78+ needs : publish
79+ if : failure()
80+ permissions :
81+ contents : read
82+ steps :
83+ - name : Checkout xero-ruby repo
84+ uses : actions/checkout@v4
85+ with :
86+ repository : XeroAPI/xero-ruby
87+ path : xero-ruby
9088
91- # - name: Send slack notification on failure
92- # uses: ./xero-ruby/.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}}
89+ - name : Send slack notification on failure
90+ uses : ./xero-ruby/.github/actions/notify-slack
91+ with :
92+ heading_text : " Publish job has failed !"
93+ alert_type : " alert"
94+ job_status : " Failed"
95+ XERO_SLACK_WEBHOOK_URL : ${{secrets.XERO_SLACK_WEBHOOK_URL}}
96+ job_url : " https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
97+ button_type : " danger"
98+ package_version : ${{needs.publish.outputs.release_number}}
99+ repo_link : ${{github.server_url}}/${{github.repository}}
0 commit comments