Skip to content

Commit

Permalink
ci: printing release number
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Oct 18, 2024
1 parent f2206dd commit c8d13b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/actions/notify-slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,29 @@ description: "Action to send slack payload to public-sdk-events channel"

inputs:
heading_text:
required: false
required: true
description: "Heading of the slack payload"
alert_type:
required: false
required: true
description: "type of the slack alert"
job_status:
required: false
required: true
description: "status of the job"
XERO_SLACK_WEBHOOK_URL:
required: false
required: true
description: "webhook url for channel - public-sdk-events"
job_url:
required: false
required: true
description: "job event link"
button_type:
required: false
description: "color for the logs button"
required: true
description: "color for the check logs button"


runs:
using: "composite"

steps:
# - name: testing
# shell: bash
# run: |
# echo ${{inputs.alert_type}}
# echo ${{inputs.heading_text}}
# echo ${{inputs.job_status}}
# echo ${{github.repository}}
# echo ${{github.sha}}

- name: Send slack notification
id: slack
Expand Down Expand Up @@ -79,10 +71,6 @@ runs:
{
"type": "mrkdwn",
"text": "*Status:*\n ${{inputs.job_status}}"
},
{
"type": "mrkdwn",
"text": "*Commit:*\n ${{github.sha}}"
}
]
},
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
outputs:
release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout xero-node repo
uses: actions/checkout@v4
Expand All @@ -32,6 +37,15 @@ jobs:
# run: npm run build
# working-directory: xero-node

- name: Fetch Latest release number
id: get_latest_release_number
run: |
latest_version=$(gh release view --json tagName --jq '.tagName')
echo "Latest release version is - $latest_version"
echo "::set-output name=release_tag::$latest_version"
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish to npm
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -49,6 +63,9 @@ jobs:
repository: XeroAPI/xero-node
path: xero-node

- name: print release number
run: echo "release number - ${{needs.publish.outputs.release_number}}"

- name: Send slack notification on success
uses: ./xero-node/.github/actions/notify-slack
with:
Expand Down

0 comments on commit c8d13b1

Please sign in to comment.