Skip to content

Commit

Permalink
👷 Trigger publish-npm-package on tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdejoie committed Nov 30, 2023
1 parent 601c64a commit d7a3c69
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
name: Publish package to npm

on:
release:
types: [created]
push:
tags:
- "*"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@zerogachis'
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://npm.pkg.github.com"
scope: "@zerogachis"

- name: Update package version
run: npm version --no-git-tag-version ${{ github.ref_name }}
- name: Update package version
run: npm version --no-git-tag-version ${{ github.ref_name }}

- name: Publish
if: startsWith(github.ref, 'refs/tags/')
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
if: startsWith(github.ref, 'refs/tags/')
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: True
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zerogachis/smartway-design-token",
"version": "0.0.2",
"version": "0.0.1",
"description": "Smartway design tokens",
"main": "tokens.json",
"scripts": {
Expand Down

0 comments on commit d7a3c69

Please sign in to comment.