* yarn set version stable * WIP * WIP * add packageManager * Add nodelinker * Add engines.node * Remove node-version * WIP * WIP * Clean up
70 lines
2.1 KiB
YAML
70 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE: ${{ github.event.release.name }}
|
|
RELEASE_ZIP: kittycad_diff-viewer_${{ github.event.release.name || github.sha }}.zip
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3.5.2
|
|
|
|
- uses: actions/setup-node@v3.6.0
|
|
with:
|
|
cache: 'yarn'
|
|
|
|
- name: Setup yarn
|
|
run: |
|
|
yarn set version stable
|
|
yarn install --immutable
|
|
|
|
- run: yarn build
|
|
|
|
- run: yarn test
|
|
|
|
- name: Run playwright e2e tests
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GLOBAL_PAT}}
|
|
KITTYCAD_TOKEN: ${{secrets.KITTYCAD_TOKEN}}
|
|
run: |
|
|
yarn playwright install chromium --with-deps
|
|
yarn playwright test
|
|
|
|
- name: Create release zip
|
|
run: |
|
|
cd build
|
|
zip -r ../$RELEASE_ZIP *
|
|
cd ..
|
|
unzip -l $RELEASE_ZIP
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: ${{ env.RELEASE_ZIP }}
|
|
name: ${{ env.RELEASE_ZIP }}
|
|
|
|
- name: Upload zip to release
|
|
if: github.event_name == 'release'
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
file: ${{ env.RELEASE_ZIP }}
|
|
|
|
- name: Upload zip to Chrome Web Store
|
|
if: github.event_name == 'release'
|
|
uses: mobilefirstllc/cws-publish@latest
|
|
with:
|
|
action: publish
|
|
client_id: ${{ secrets.CHROME_WEBSTORE_CLIENT_ID }}
|
|
client_secret: ${{ secrets.CHROME_WEBSTORE_CLIENT_SECRET }}
|
|
refresh_token: ${{ secrets.CHROME_WEBSTORE_REFRESH_TOKEN }}
|
|
extension_id: gccpihmphokfjpohkmkbimnhhnlpmegp
|
|
zip_file: ${{ env.RELEASE_ZIP }}
|