@@ -23,85 +23,85 @@ jobs:
2323 repository : XeroAPI/xero-ruby
2424 path : xero-ruby
2525
26- # - name: Fetch Latest release number
27- # id: get_latest_release_number
28- # run: |
29- # latest_version=$(gh release view --json tagName --jq '.tagName')
30- # echo "Latest release version is - $latest_version"
31- # echo "::set-output name=release_tag::$latest_version"
32- # working-directory: xero-ruby
33- # env:
34- # GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+ - name : Fetch Latest release number
27+ id : get_latest_release_number
28+ run : |
29+ latest_version=$(gh release view --json tagName --jq '.tagName')
30+ echo "Latest release version is - $latest_version"
31+ echo "::set-output name=release_tag::$latest_version"
32+ working-directory : xero-ruby
33+ env :
34+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
3535
36- # - name: Set up Ruby environment
37- # uses: ruby/setup-ruby@v1
38- # with:
39- # ruby-version: '3.2.0'
40- # bundler-cache: true
36+ - name : Set up Ruby environment
37+ uses : ruby/setup-ruby@v1
38+ with :
39+ ruby-version : ' 3.2.0'
40+ bundler-cache : true
4141
42- # - name: Install dependencies
43- # run: bundle install
44- # working-directory: xero-ruby
42+ - name : Install dependencies
43+ run : bundle install
44+ working-directory : xero-ruby
4545
46- # - name: Publish to Ruby
47- # env:
48- # GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
49- # run: |
50- # gemspec_file=$(ls *.gemspec)
51- # gem_file=$(gem build "$gemspec_file" | grep -o '[^ ]*\.gem')
52- # echo "$gem_file"
53- # gem push "$gem_file"
54- # working-directory: xero-ruby
46+ - name : Publish to Ruby
47+ env :
48+ GEM_HOST_API_KEY : ${{ secrets.RUBYGEMS_API_KEY }}
49+ run : |
50+ gemspec_file=$(ls *.gemspec)
51+ gem_file=$(gem build "$gemspec_file" | grep -o '[^ ]*\.gem')
52+ echo "$gem_file"
53+ gem push "$gem_file"
54+ working-directory : xero-ruby
5555
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-ruby repo
64- # uses: actions/checkout@v4
65- # with:
66- # repository: XeroAPI/xero-ruby
67- # path: xero-ruby
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-ruby repo
64+ uses : actions/checkout@v4
65+ with :
66+ repository : XeroAPI/xero-ruby
67+ path : xero-ruby
6868
69- # - name: Send slack notification on success
70- # uses: ./xero-ruby/.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}}
69+ - name : Send slack notification on success
70+ uses : ./xero-ruby/.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}}
8080
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-ruby repo
89- # uses: actions/checkout@v4
90- # with:
91- # repository: XeroAPI/xero-ruby
92- # path: xero-ruby
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-ruby repo
89+ uses : actions/checkout@v4
90+ with :
91+ repository : XeroAPI/xero-ruby
92+ path : xero-ruby
9393
94- # - name: Send slack notification on failure
95- # uses: ./xero-ruby/.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}}
94+ - name : Send slack notification on failure
95+ uses : ./xero-ruby/.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}}
105105 notify-codegen-repo :
106106 needs : publish
107107 if : always()
@@ -147,7 +147,7 @@ jobs:
147147 "status": "${{needs.publish.result}}",
148148 "deployer": "xero-codegen-bot",
149149 "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
150- "environment": "test ",
150+ "environment": "prod ",
151151 "sdk_type": "ruby",
152152 "cab_key": "${{ github.event.inputs.cab_id }}"
153153 }
0 commit comments