GitHub action publish new version #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub action publish new version | |
on: | |
workflow_dispatch: | |
inputs: | |
versionType: | |
type: choice | |
description: Version Type | |
required: true | |
options: | |
- patch | |
- minor | |
- major | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
name: Publish github action version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install npm deps | |
run: npm ci | |
- name: Configure git | |
run: git config --global user.email "y-infra@yandex.ru" && git config --global user.name "y-infra" | |
- name: Bump version | |
run: npm version ${{ github.event.inputs.versionType }} | |
- name: Build github action | |
run: npm run ci:build | |
- name: Commit version | |
run: git add dist -f && git commit --amend --no-edit dist && git push --follow-tags |