[fix] Action Publish #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
- run: corepack enable | |
- run: pnpm install | |
- run: pnpm run build:check | |
publish-gpr: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
registry-url: https://npm.pkg.github.com | |
scope: '@thatcompanys/axios' | |
- run: corepack enable | |
- name: set scope | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
jq --arg name "@thatcoders/axios" --arg ry "https://npm.pkg.github.com" ' | |
.name = $name | | |
.publishConfig.registry = $ry' package.json > package.json.new | |
mv package.json.new package.json | |
- run: pnpm install | |
- run: pnpm run build:check | |
- run: pnpm run publish:gpr | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }} | |
publish-gpr-org: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
registry-url: https://npm.pkg.github.com | |
scope: '@thatcompanys/axios' | |
- run: corepack enable | |
- name: set scope | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
jq --arg name "@thatcompanys/axios" --arg ry "https://npm.pkg.github.com" ' | |
.name = $name | | |
.publishConfig.registry = $ry' package.json > package.json.new | |
mv package.json.new package.json | |
- run: pnpm install | |
- run: pnpm run build:check | |
- run: npm publish --tag latest --registry https://npm.pkg.github.com --access public --scope @thatcompanys/axios | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }} | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
registry-url: https://registry.npmjs.org | |
scope: '@thatcompany/axios' | |
- run: corepack enable | |
- name: set scope | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
jq --arg name "@thatcompany/axios" --arg registry "https://registry.npmjs.org" ' | |
.name = $name | | |
.publishConfig.registry = $registry' package.json > package.json.new | |
mv package.json.new package.json | |
- run: pnpm install | |
- run: pnpm run build:check | |
- run: pnpm run publish:npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-that: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 21 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21 | |
registry-url: https://registry.npmjs.org | |
scope: 'that-axios' | |
- run: corepack enable | |
- name: set scope | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
jq --arg name "that-axios" --arg registry "https://registry.npmjs.org" ' | |
.name = $name | | |
.publishConfig.registry = $registry' package.json > package.json.new | |
mv package.json.new package.json | |
- run: pnpm install | |
- run: pnpm run build:check | |
- run: pnpm run publish:that | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |