Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloemendaal committed Nov 7, 2023
1 parent a697dc5 commit 561a316
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 45 deletions.
60 changes: 18 additions & 42 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,36 @@
name: Node.js build and publish package
name: Publish Package

on:
release:
types: [created]

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm i
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Checkout Repository
uses: actions/checkout@v3

publish-private-package:
needs: build
name: Build and publish a private NodeJS package
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
scope: '@zonneplan'

- run: npm i
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: npm install

- name: Build
run: npm run build

- run: npm run build
- name: Get the version from the tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: npm publish --new-version ${{ env.RELEASE_VERSION }} --tag latest --no-git-tag-version
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions .npmrc

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
},
"publishConfig": {
"@zonneplan:registry": "https://npm.pkg.github.com/"
}
}

0 comments on commit 561a316

Please sign in to comment.