Publish Package to npmjs #8
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 to npmjs | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: Linux | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@wroud' | |
cache: 'yarn' | |
- name: Setup .yarnrc.yml | |
run: | | |
yarn config set npmAlwaysAuth true | |
yarn config set npmPublishRegistry "https://registry.npmjs.org" | |
yarn config set npmAuthToken $NPM_AUTH_TOKEN | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Install modules | |
run: yarn install --immutable | |
- name: Build modules | |
run: yarn build | |
- name: Run tests | |
run: yarn test | |
- name: Publish to npm | |
run: yarn npm publish --access public --tolerate-republish | |
working-directory: ./packages/di |