Merge branch 'main' into alpha #12
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: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Setup pnpm | |
run: npm install -g pnpm | |
- run: pnpm install | |
- run: pnpm run ci | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Setup pnpm | |
run: npm install -g pnpm | |
- run: pnpm install | |
- run: pnpm run make | |
- name: Authenticate with npm | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Publish package | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Post-publish cleanup | |
run: rm ~/.npmrc | |
# - name: Get version from package.json | |
# run: echo "VERSION=$(node -p require\(\"./package.json\"\).version)" >> $GITHUB_ENV | |
# - name: Create GitHub Release | |
# uses: actions/create-release@v1 | |
# with: | |
# tag_name: v${{ env.VERSION }} | |
# release_name: Release v${{ env.VERSION }} | |
# draft: false | |
# prerelease: false | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |