Skip to content

Commit

Permalink
Merge pull request #4 from ZeroGachis/main
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
ulricden authored Feb 16, 2024
2 parents 43ba92a + 01ccc85 commit 6314e3e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
name: Publish package to npm

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

jobs:
build:
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
uses: mingjun97/file-regex-replace@v1
with:
regex: '"version": "([0-9.]*)"'
replacement: '"version": "${{ github.ref_name }}"'
include: 'package.json'
- 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
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@zerogachis/smartway-design-token",
"version": "0.0.0",
"version": "0.0.1",
"description": "Smartway design tokens",
"main": "tokens.json",
"scripts": {
"test": "echo \"Test\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ZeroGachis/smartway-design-token.git"
Expand Down

0 comments on commit 6314e3e

Please sign in to comment.