Skip to content

Commit

Permalink
feat: publish to github registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Joozty committed May 6, 2024
1 parent f33a849 commit ad65117
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,24 @@ jobs:
- name: Install pnpm
run: npm i pnpm@8 -g

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Setup pnpm cache directory
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
- name: Publish packages
working-directory: .
run: |
npm config set //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
CWD=`pwd`
cd $CWD/packages/eslint/eslint-config-base && npm ${{ env.PUBLISH_COMMAND }}
cd $CWD/packages/eslint/eslint-config-node && npm ${{ env.PUBLISH_COMMAND }}
cd $CWD/packages/eslint/eslint-config-prettier && npm ${{ env.PUBLISH_COMMAND }}
cd $CWD/packages/eslint/eslint-config-typescript && npm ${{ env.PUBLISH_COMMAND }}
cd $CWD/packages/prettier/prettier-config && npm ${{ env.PUBLISH_COMMAND }}
cd $CWD
env:
PUBLISH_COMMAND: ${{ contains(github.ref, 'beta') && 'publish --tag beta' || 'publish' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion packages/eslint/eslint-config-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"engines": {
"node": "^14 || >=16"
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint/eslint-config-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"engines": {
"node": "^14 || >=16"
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint/eslint-config-prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"engines": {
"node": "^14 || >=16"
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint/eslint-config-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"engines": {
"node": "^14 || >=16"
Expand Down
3 changes: 2 additions & 1 deletion packages/prettier/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"engines": {
"node": "^14 || >=16"
Expand Down

0 comments on commit ad65117

Please sign in to comment.