Update Package Version #2
This file contains 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: Update Package Version | |
# Version: 1.0.0 | |
# Modified: No | |
# Requirements: | |
# - A valid package.json | |
# - The `Homey Github Actions Bot` should have `Admin` level access to the repository, | |
# to bypass push restrictions. | |
# | |
# Required secrets: | |
# - HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN | |
on: | |
workflow_dispatch: | |
branches: | |
- master | |
inputs: | |
newversion: | |
type: choice | |
description: New Version | |
required: true | |
default: patch | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }} | |
- name: Set up node 16 environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Version | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Homey Github Actions Bot" | |
git pull | |
npm version ${{ github.event.inputs.newversion }} | |
git push --follow-tags |