diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 304d259..a31a6c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,8 @@ name: Node.js Package on: + push: + branches: [main] release: types: [created] @@ -8,10 +10,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - node-version: 21 + node-version: "21.x" - run: corepack enable && yarn install - run: yarn build @@ -22,12 +24,17 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - node-version: 21 + node-version: "21.x" registry-url: https://npm.pkg.github.com/ + scope: "@MoreChickenDelivered" - run: corepack enable + - run: git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" && git config --global user.name "$GITHUB_ACTOR" + - run: yarn version --minor + - run: git push --tags && git push + - run: yarn publish - run: yarn npm publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..36c5a5c --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1,4 @@ +npmScopes: + esp-code: + npmAlwaysAuth: true + npmAuthToken: "${NPM_AUTH_TOKEN}" diff --git a/package.json b/package.json index c4a86aa..4228610 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,8 @@ }, "files": [ "index.d.ts" - ] + ], + "publishConfig": { + "registry": "https://npm.pkg.github.com" + } }