FIX: copy func in publish #36
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [18.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache ~/.pnpm-store | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-pnpm-store | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-${{ matrix.node-version }}-test- | |
${{ runner.os }}- | |
- name: Install pnpm | |
run: npm i -g pnpm | |
- name: Install deps | |
run: pnpm i | |
- name: Build and Test | |
run: pnpm test | |
release: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [18.x] | |
runs-on: ${{matrix.os}} | |
needs: ["test"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Cache ~/.pnpm-store | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-pnpm-store | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}- | |
${{ runner.os }}-${{ matrix.node-version }}-release- | |
${{ runner.os }}- | |
- run: npm i -g pnpm | |
- run: pnpm i | |
- run: pnpm run clean || true | |
- run: pnpm run build | |
- run: pnpm run copy-files | |
- run: pnpm dlx semantic-release@20 --branches main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
permissions: | |
contents: write | |
pages: write | |
id-token: write |