Skip to content

Commit

Permalink
Deploying to npm.pkg.github.com, take 9
Browse files Browse the repository at this point in the history
  • Loading branch information
mojir committed Jan 14, 2025
1 parent 8e6b8b6 commit 611478c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 74 deletions.
52 changes: 0 additions & 52 deletions .github/workflow/publish.yml

This file was deleted.

39 changes: 17 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: Publish Package to GitHub Packages
on:
push:
branches:
- master
# push:
# branches:
# - master
workflow_dispatch:

jobs:
build:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
scope: '@${{ github.repository_owner }}'

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
- name: Bump version
run: npm version patch

Expand All @@ -34,24 +38,15 @@ jobs:
- name: Build
run: npm run build

# - name: Publish to GitHub Packages
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Git config
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit version bump
run: |
git add .
git commit -m 'ci: bump version'
git push
- name: Create Git tag
run: |
TAG_NAME=$(npm pkg get version | tr -d '"')
git tag v$TAG_NAME
git push origin v$TAG_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 611478c

Please sign in to comment.