tonthanhhung / tag-gh-publish-action

GitHub action to automatically publish packages to Github repo tag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tag-gh-publish-action

GitHub action to automatically publish packages to github tag.

Usage

Create a new .github/workflows/tag-release.yml file:

name: tag-release
on:
  push:
    branches:
      - master # Change this to your default branch
jobs:
  tag-release:
    name: tag-release
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@master
    - name: Set up Node.js
      uses: actions/setup-node@master
      with:
        node-version: 10.0.0
    - name: Publish if version has been updated
      uses: tonthanhhung/tag-gh-publish-action@168e35e
      env: # More info about the environment variables in the README
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated        

Now, when someone changes the version in package.json to 1.2.3 and pushes a commit with the message Release 1.2.3, the tag-release action will create a new tag v1.2.3 and publish the package to the npm registry.

Environment variables

  • GITHUB_TOKEN: this is a token that GitHub generates automatically, you only need to pass it to the action as in the example

Related projects

  • version-check allows to define custom workflows based on version changes

License

MIT

About

GitHub action to automatically publish packages to Github repo tag

License:MIT License


Languages

Language:JavaScript 90.8%Language:Dockerfile 9.2%