From d1858036155dd57879023b771d2748d6bdd2b23e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 12 Jan 2024 22:53:48 +0000 Subject: [PATCH] v1.4.0 --- .github/workflows/bump.yaml | 64 +++++++++++++++++++++ .github/workflows/{ci.yaml => publish.yaml} | 64 +-------------------- package-lock.json | 4 +- 3 files changed, 69 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/bump.yaml rename .github/workflows/{ci.yaml => publish.yaml} (50%) diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml new file mode 100644 index 0000000..e2df36a --- /dev/null +++ b/.github/workflows/bump.yaml @@ -0,0 +1,64 @@ +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 }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/publish.yaml similarity index 50% rename from .github/workflows/ci.yaml rename to .github/workflows/publish.yaml index 9d77602..710a9f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/publish.yaml @@ -1,68 +1,10 @@ -name: Bump and Release +name: Publish on: push: - branches: - - main - -permissions: - contents: write + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' 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 }} - publish-choice: runs-on: ubuntu-latest needs: bump diff --git a/package-lock.json b/package-lock.json index 4007600..79cb6ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "telenode-js", - "version": "1.3.2", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "telenode-js", - "version": "1.3.2", + "version": "1.4.0", "license": "MIT", "dependencies": { "axios": "^1.6.5"