chore(root): change linux-latest for ubuntu-latest #338
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: publish | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: "*" | |
jobs: | |
install-and-cache: | |
name: Install dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Upload pnpm-lock.yaml as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pnpm-lock | |
path: pnpm-lock.yaml | |
outputs: | |
lock-file: ./pnpm-lock.yaml | |
build: | |
name: Build Project | |
runs-on: ubuntu-latest | |
needs: [install-and-cache] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'pnpm' | |
- name: Download pnpm-lock.yaml artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: pnpm-lock | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Build package | |
working-directory: ./packages/v3 | |
run: pnpm run build | |
- name: Upload dist as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./packages/v3/dist | |
test: | |
name: Test project on linux and windows | |
runs-on: ${{ matrix.os }} | |
needs: [install-and-cache, build] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
node-version: [18.x, 20.x, 22.x] | |
test-plan: [test, "test:e2e"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: pnpm install | |
- name: Create env file | |
run: | | |
touch ./packages/v3/cypress/runner/.env | |
echo VITE_GOOGLE_API_KEY=${{ secrets.VITE_GOOGLE_API_KEY }} >> ./packages/v3/cypress/runner/.env | |
- name: Run Test Plan | |
run: pnpm run ${{ matrix.test-plan }} | |
publish: | |
name: NPM publish | |
runs-on: ubuntu-latest | |
needs: [install-and-cache, build, test] | |
if: ${{ github.ref == 'refs/heads/master'}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'pnpm' | |
- name: Download pnpm-lock.yaml artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: pnpm-lock | |
- name: Download dist artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Configure git credentials | |
uses: OleksiyRudenko/gha-git-credentials@v2-latest | |
with: | |
global: true | |
name: "${{ secrets.GH_USER }}" | |
email: "${{ secrets.GH_EMAIL }}" | |
actor: "${{ secrets.GH_FULL_NAME }}" | |
token: "${{ secrets.GH_TOKEN_REPO }}" | |
- name: Update origin push URI | |
run: | | |
git remote set-url origin "https://${{ secrets.GH_TOKEN_REPO }}@github.com/${{ secrets.GH_USER }}/${{ secrets.GH_REPOSITORY }}.git" > /dev/null 2>&1 | |
git checkout master | |
- name: Preparing new release | |
working-directory: ./packages/v3 | |
run: pnpm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
CI: true | |
- name: Publish new version to npm | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: ./packages/v3/package.json |