Skip to content

fixed CI/CD

fixed CI/CD #3

Workflow file for this run

name: Bump
on:
push:
branches:
- main
permissions:
contents: write
jobs:
bump-choice:
runs-on: ubuntu-latest
outputs:
user-choice: ${{ steps.bump-input.outputs.user-choice }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get bump input from Telegram
id: bump-input
uses: NivEz/interactive-inputs-action@v1
with:
telegram-api-token: ${{ secrets.TELEGRAM_API_TOKEN }}
telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }}
question: 'Updating Telenode. Which bump type you wish to perform?'
options: '["prerelease", "patch", "minor", "major", "skip"]'
default-choice: 'skip'
message: 'The selected bump type is: %s'
timeout: 45
wait-for-timeout-to-finish: true
bump:
runs-on: ubuntu-latest
needs: bump-choice
if: needs.bump-choice.outputs.user-choice != 'skip'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup git config
run: |
git config user.name "GitHub Actions"
git config user.email "${{ secrets.GIT_CONFIG_EMAIL }}"
- name: Bump version
run: npm version ${{ needs.bump-choice.outputs.user-choice }} -m "v%s"
- name: Push
run: git push --follow-tags
- name: Build success message
id: success-message
run: |
latest_tag="$(git describe --abbrev=0 --tags)"
message="Successfully bumped a [${{ needs.bump-choice.outputs.user-choice }}] update: $latest_tag"
echo $message
echo "message=$message" >> $GITHUB_OUTPUT
- name: Send message
uses: NivEz/interactive-inputs-action@v1
with:
telegram-api-token: ${{ secrets.TELEGRAM_API_TOKEN }}
telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }}
simple-message: ${{ steps.success-message.outputs.message }}