Update change all the tree method & prod easier #35
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Tasye Languages Tools | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Publish to NPM and GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
cache: npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Build Package for Production | |
run: npm run build | |
publish-npm: | |
name: Publish to npm | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm ci | |
# error in this line https://github.com/Tasye24/tasye-languages-tools/issues/1 | |
- run: npm publish --access=public --registry https://registry.npmjs.org/ | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GHUB_TOKEN }} | |
publish-gpr: | |
name: Publish to GitHub Packages | |
needs: | |
- build | |
- publish-npm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://npm.pkg.github.com/ | |
scope: '@tasye24' | |
- run: echo registry="https://npm.pkg.github.com/tasye24 >> .npmrc" | |
- run: npm publish --access=public --registry https://npm.pkg.github.com/ | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GHUB_TOKEN}} |