chore: fix release with latest tag (#1544) #617
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 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
permissions: | |
contents: read | |
env: | |
CI: true | |
NODE_OPTIONS: --max-old-space-size=6144 | |
jobs: | |
lint: | |
name: Lint | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Lint codes | |
run: pnpm lint | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node: [16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build codes | |
run: pnpm build --all -t | |
- name: Cache dist | |
uses: actions/cache@v3 | |
with: | |
path: packages/*/dist | |
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }} | |
test-unit: | |
name: Unit test | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node: [16, 18.16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Run unit tests | |
run: | | |
pnpm test:cover | |
test-type: | |
name: Type checking | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Run type checking | |
run: pnpm test:type | |
test-e2e: | |
name: E2E test | |
needs: | |
- build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node: [16, 18.16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62 | |
# Install playwright's binary under custom directory to cache | |
- name: Set Playwright path | |
if: runner.os != 'Windows' | |
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV | |
- name: Set Playwright path (windows) | |
if: runner.os == 'Windows' | |
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV | |
- name: Cache Playwright's binary | |
uses: actions/cache@v3 | |
with: | |
# Playwright removes unused browsers automatically | |
# So does not need to add playwright version to key | |
key: ${{ runner.os }}-playwright-bin-v1 | |
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | |
- name: Install Playwright | |
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved | |
run: pnpm playwright install chromium | |
- name: Restore dist cache | |
uses: actions/cache@v3 | |
with: | |
path: packages/*/dist | |
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }} | |
- name: Run e2e tests | |
run: pnpm test:e2e | |
edge-release: | |
if: | | |
github.event_name == 'push' && | |
!contains(github.event.head_commit.message, '[skip-release]') && | |
!contains(github.event.head_commit.message, 'chore') && | |
!contains(github.event.head_commit.message, 'docs') | |
needs: | |
- lint | |
- build | |
- test-unit | |
- test-type | |
- test-e2e | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [16] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: Enable corepack | |
run: corepack enable | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Restore dist cache | |
uses: actions/cache@v3 | |
with: | |
path: packages/*/dist | |
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }} | |
- name: Release edge version | |
run: ./scripts/release-edge.sh | |
env: | |
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} |