diff --git a/.github/workflow/publish.yml b/.github/workflow/publish.yml deleted file mode 100644 index 1faafcf..0000000 --- a/.github/workflow/publish.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish Package to GitHub Packages -on: - # push: - # branches: - # - master - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - - 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 "github-actions@users.noreply.github.com" - git config --global user.name "github-actions" - - - name: Bump version - run: npm version patch - - - name: Install dependencies - run: npm ci - - - name: Run lint - run: npm run lint - - - name: Run tests - run: npm test - - - name: Build - run: npm run build - - - 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 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b88bfc3..1faafcf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 "github-actions@users.noreply.github.com" + git config --global user.name "github-actions" + - name: Bump version run: npm version patch @@ -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 }}