Version packages #266
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 CI | |
concurrency: main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
outputs: | |
changes: ${{ steps.version.outputs.changes }} # map step output to job output | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
token: ${{ secrets.SERVICE_ACCOUNT_PAT }} | |
- name: Enable node | |
uses: actions/setup-node@master | |
with: | |
node-version: 14.x | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@wanews' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Cache .pnpm-store | |
uses: actions/cache@v1 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install pnpm | |
run: | | |
npm i -g pnpm@6 | |
pnpm set verify-store-integrity false | |
- name: pnpm install | |
run: | | |
pnpm install --frozen-lockfile | |
- name: Version command | |
id: version | |
run: | | |
pnpm changeset version | |
env: | |
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PAT }} | |
- name: pnpm install | |
run: | | |
pnpm install | |
- name: Push changes | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "SWM GitHub Service Account" | |
git add -A | |
git commit -m "Version packages" || echo "No changes to commit" | |
git push | |
- name: typecheck | |
run: pnpm tsc -b | |
- name: Build packages | |
run: pnpm run build | |
- name: Lint types and code | |
run: pnpm run lint | |
- name: Run tests | |
run: pnpm test | |
- name: Run e2e tests | |
run: pnpm e2e | |
- name: Release packages | |
uses: changesets/action@master | |
with: | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PAT }} |