Automatically add github scope when the package isn't scoped #6
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: Post-merge | |
on: | |
push: | |
branches: [main] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: corepack enable && pnpm install --frozen-lockfile | |
- name: Build package | |
run: pnpm run build | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [lts/*, lts/-1, current] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: corepack enable && pnpm install --frozen-lockfile | |
- name: Run test suite | |
run: pnpm run test | |
version_or_publish: | |
name: Version or publish package | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Use Node LTS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: corepack enable && pnpm install --frozen-lockfile | |
- name: Creating .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Version or publish package | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
title: Release package | |
publish: pnpm run release | |
createGithubReleases: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |