git-backporting/.github/workflows/release.yml
2022-12-23 22:47:41 +01:00

47 lines
1.5 KiB
YAML

# This workflow create a new tag and then publish it to NPM.
name: "Release Package"
on:
workflow_dispatch:
inputs:
version:
description: 'version to bump [major, minor, patch, premajor, preminor, prepatch, prerelease]'
required: false
default: patch
type: string
message:
description: 'bump version commit message'
required: false
default: 'Bump release version %s'
type: string
jobs:
tag-and-publish:
name: "Tag and Publish"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: git config --global user.name "Github" && git config --global user.email "noreply@github.com"
- run: npm version ${{ inputs.version }} -m "${{ inputs.message }}"
- run: npm install && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# create-release:
# name: "Create Release"
# needs: tag-and-publish
# runs-on: "ubuntu-latest"
# steps:
# - uses: actions/checkout@v3
# - id: package-version
# uses: martinbeentjes/npm-get-version-action@main
# - uses: marvinpinto/action-automatic-releases@latest
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "v${{ steps.package-version.outputs.current-version}}"
# prerelease: false