chore: temporary set CI false #38
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: build-test-publish-on-push-cached | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'next' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CI: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install pnpm | |
run: npm install -g pnpm@8.6.0 | |
- run: pnpm install | |
- run: pnpm build | |
- name: 'Save build output' | |
uses: actions/cache/save@v3 | |
with: | |
path: ${{ github.workspace }} | |
key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} | |
publish: | |
needs: | |
- build | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
CI: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{secrets.GITHUB_TOKEN}} | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install pnpm | |
run: npm install -g pnpm@8.6.0 | |
- name: 'Restore build output' | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ github.workspace }} | |
key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} | |
restore-keys: ${{ runner.os }}-build-${{ github.sha }} | |
fail-on-cache-miss: true | |
- name: 'Setup git coordinates' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY | |
- name: 'Setup npm registry' | |
run: | | |
echo "@vckit:registry=https://registry.npmjs.org/" > .npmrc | |
echo "registry=https://registry.npmjs.org/" >> .npmrc | |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc | |
npm whoami | |
- name: 'Publish @latest when on main' | |
if: github.ref == 'refs/heads/main' | |
run: pnpm publish:latest | |
- name: 'Publish @next when on next' | |
if: github.ref == 'refs/heads/next' | |
run: pnpm publish:next |