From d7a3c69e582c58d5a4f62eeee8e20885084e9396 Mon Sep 17 00:00:00 2001 From: Clement DEJOIE Date: Thu, 30 Nov 2023 15:31:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Trigger=20publish-npm-package=20?= =?UTF-8?q?on=20tag=20push?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-npm-package.yml | 44 +++++++++++++---------- package.json | 2 +- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish-npm-package.yml b/.github/workflows/publish-npm-package.yml index 467b70f..7da694f 100644 --- a/.github/workflows/publish-npm-package.yml +++ b/.github/workflows/publish-npm-package.yml @@ -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 }} \ No newline at end of file + - 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 diff --git a/package.json b/package.json index b420d3d..3ae861b 100644 --- a/package.json +++ b/package.json @@ -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": {