docs(getting-started): remove reference to HMR #15417
Workflow file for this run
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
# Build and test everything | |
# | |
# First it builds the packages and stores them in artifacts. | |
# Meanwhile it lints the code. | |
# Then it runs the unit tests with the artifacts, as well as builds the docs and insights | |
# Once it all works, it does a release | |
name: Qwik CI | |
# TODO fix e2e tests hanging and not cancelling | |
# # We only need one instance of the workflow running at a time, per branch | |
# concurrency: | |
# group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
# cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- next | |
- qwik-labs | |
- vercelserverless | |
- 'build/**' | |
workflow_dispatch: | |
inputs: | |
disttag: | |
description: 'Publish "@builder.io/qwik" to NPM using this dist-tag, push the git-tag to the repo and create a GitHub release. The "latest" and "next" dist-tags will use the version number already committed in package.json.' | |
required: true | |
type: choice | |
default: 'dev' | |
options: | |
- dev | |
- next | |
- latest | |
env: | |
# Disable incremental build, speeds up CI | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
changes: | |
name: Setup | |
runs-on: ubuntu-latest | |
outputs: | |
hash-qwik: ${{ steps.cache-qwik.outputs.cache-primary-key }} | |
hash-rust: ${{ steps.cache-rust.outputs.cache-primary-key }} | |
hash-others: ${{ steps.cache-others.outputs.cache-primary-key }} | |
hash-docs: ${{ steps.cache-docs.outputs.cache-primary-key }} | |
hash-insights: ${{ steps.cache-insights.outputs.cache-primary-key }} | |
build-qwik: ${{ steps.cache-qwik.outputs.cache-hit != 'true' }} | |
build-rust: ${{ steps.cache-rust.outputs.cache-hit != 'true' }} | |
build-others: ${{ steps.cache-others.outputs.cache-hit != 'true' }} | |
build-docs: ${{ steps.cache-docs.outputs.cache-hit != 'true' }} | |
build-insights: ${{ steps.cache-insights.outputs.cache-hit != 'true' }} | |
steps: | |
- name: Branch | |
run: echo "${{ github.ref }}" | |
- name: NPM Dist Tag | |
run: echo "${{ github.event.inputs.disttag }}" | |
- name: Github event | |
run: echo event_name=${{ github.event_name }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: 'check cache: qwik' | |
id: cache-qwik | |
uses: actions/cache/restore@v4 | |
with: | |
lookup-only: true | |
path: packages/qwik/dist | |
key: ${{ hashfiles('pnpm-lock.yaml', 'packages/qwik/**/*') }} | |
- name: 'check cache: rust' | |
id: cache-rust | |
uses: actions/cache/restore@v4 | |
with: | |
lookup-only: true | |
path: packages/qwik/dist/bindings | |
key: ${{ hashfiles('rust-toolchain', '**/Cargo.toml', '**/Cargo.lock', '**/*.rs') }} | |
- name: 'check cache: others' | |
id: cache-others | |
uses: actions/cache/restore@v4 | |
with: | |
lookup-only: true | |
path: | | |
packages/qwik-city/lib | |
packages/qwik-labs/lib | |
packages/qwik-labs/vite | |
packages/qwik-react/lib | |
packages/qwik-react/vite | |
packages/eslint-plugin-qwik/dist | |
packages/create-qwik/dist | |
# note that all inputs need to be listed here, including qwik, for correct cache invalidation | |
key: ${{ hashfiles('pnpm-lock.yaml', 'packages/qwik/**/*', 'rust-toolchain', '**/Cargo.toml', '**/Cargo.lock', '**/*.rs', 'packages/qwik-city/**/*', 'packages/qwik-labs/**/*', 'packages/qwik-react/**/*', 'packages/eslint-plugin-qwik/**/*', 'packages/create-qwik/**/*') }} | |
- name: 'check cache: docs' | |
id: cache-docs | |
uses: actions/cache/restore@v4 | |
with: | |
lookup-only: true | |
path: | | |
packages/docs/dist | |
packages/docs/server | |
key: ${{ hashfiles('pnpm-lock.yaml', 'packages/qwik/**/*', 'rust-toolchain', '**/Cargo.toml', '**/Cargo.lock', '**/*.rs', 'packages/qwik-city/**/*', 'packages/qwik-labs/**/*', 'packages/qwik-react/**/*', 'packages/docs/**/*') }} | |
- name: 'check cache: insights' | |
id: cache-insights | |
uses: actions/cache/restore@v4 | |
with: | |
lookup-only: true | |
path: | | |
packages/insights/dist | |
packages/insights/.netlify | |
key: ${{ hashfiles('pnpm-lock.yaml', 'packages/qwik/**/*', 'rust-toolchain', '**/Cargo.toml', '**/Cargo.lock', '**/*.rs', 'packages/qwik-city/**/*', 'packages/qwik-labs/**/*', 'packages/qwik-insights/**/*') }} | |
############ BUILD Qwik ############ | |
build-qwik: | |
if: needs.changes.outputs.build-qwik == 'true' | |
name: Build Qwik | |
needs: changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- name: Install NPM Dependencies | |
run: | | |
corepack enable | |
# Ensure that the qwik binary gets made | |
mkdir -p packages/qwik/dist/bindings/ | |
pnpm install --frozen-lockfile | |
- name: 'build: qwik' | |
run: pnpm build --qwik --set-dist-tag="${{ github.event.inputs.disttag }}" | |
- name: Print Qwik Dist Build | |
continue-on-error: true | |
run: tree packages/qwik/dist/ | |
- name: Save artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-qwik-no-optimizer | |
path: packages/qwik/dist/ | |
if-no-files-found: error | |
############ BUILD RUST ############ | |
build-linux-wasm-bindings: | |
if: needs.changes.outputs.build-rust == 'true' | |
name: Build optimizer x86 Linux + wasm | |
needs: changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
# additionally install wasm32-unknown-unknown target | |
target: wasm32-unknown-unknown | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
# This installs everything + the latest wasm-pack binary | |
- run: pnpm install wasm-pack | |
- name: Build x86 Platform Binding | |
run: pnpm build --platform-binding | |
- name: Build wasm Platform Binding | |
run: pnpm build --wasm | |
- name: Print Packages Dist Build | |
continue-on-error: true | |
run: ls -lR packages/qwik/dist/bindings/ | |
- name: Upload Platform Binding Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-bindings-wasm | |
path: packages/qwik/dist/bindings/* | |
if-no-files-found: error | |
############ BUILD PLATFORM BINDINGS ############ | |
build-other-bindings: | |
if: needs.changes.outputs.build-rust == 'true' | |
strategy: | |
matrix: | |
settings: | |
# the last x86 macos available as a standard runner | |
- host: macos-13 | |
target: x86_64-apple-darwin | |
- host: macos-latest | |
target: aarch64-apple-darwin | |
- host: windows-latest | |
target: x86_64-pc-windows-msvc | |
name: Build optimizer ${{ matrix.settings.target }} | |
runs-on: ${{ matrix.settings.host }} | |
needs: changes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- run: pnpm install | |
- name: Build Platform Binding | |
run: pnpm build --platform-binding | |
- name: Print Packages Dist Build | |
continue-on-error: true | |
run: ls -lR packages/qwik/dist/bindings/ | |
- name: Upload Platform Binding Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-bindings-${{ matrix.settings.target }} | |
path: packages/qwik/dist/bindings/*.node | |
if-no-files-found: error | |
############ BUILD PACKAGE ############ | |
combined-qwik: | |
name: Bundle Qwik | |
if: | | |
always() && | |
(needs.build-qwik.result == 'success' || | |
needs.build-qwik.result == 'skipped') && | |
(needs.build-linux-wasm-bindings.result == 'success' || | |
needs.build-linux-wasm-bindings.result == 'skipped') && | |
(needs.build-other-bindings.result == 'success' || | |
needs.build-other-bindings.result == 'skipped') | |
runs-on: ubuntu-latest | |
needs: | |
- build-qwik | |
- build-linux-wasm-bindings | |
- build-other-bindings | |
- changes | |
steps: | |
- name: Restore artifacts | |
uses: actions/download-artifact@v4 | |
- name: Restore Qwik from cache | |
if: needs.changes.outputs.build-qwik != 'true' | |
uses: actions/cache/restore@v4 | |
with: | |
path: packages/qwik/dist | |
key: ${{ needs.changes.outputs.hash-qwik }} | |
- name: Move Qwik artifact | |
if: needs.changes.outputs.build-qwik == 'true' | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik-no-optimizer/* packages/qwik/dist/ | |
- name: Restore Rust from cache | |
if: needs.changes.outputs.build-rust != 'true' | |
uses: actions/cache/restore@v4 | |
with: | |
path: packages/qwik/dist/bindings | |
key: ${{ needs.changes.outputs.hash-rust }} | |
- name: Move Rust Artifacts | |
if: needs.changes.outputs.build-rust == 'true' | |
run: | | |
mkdir -p packages/qwik/dist/bindings | |
mv dist-bindings-*/* packages/qwik/dist/bindings | |
- name: Upload Qwik artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-qwik | |
path: packages/qwik/dist/ | |
if-no-files-found: error | |
build-other-packages: | |
name: Build Other Packages | |
needs: | |
- changes | |
- combined-qwik | |
if: always() && needs.combined-qwik.result == 'success' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
if: needs.changes.outputs.build-others == 'true' | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
if: needs.changes.outputs.build-others == 'true' | |
- name: Setup Node | |
if: needs.changes.outputs.build-others == 'true' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- name: Restore Qwik artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-qwik | |
path: packages/qwik/dist/ | |
- name: Install NPM Dependencies | |
if: needs.changes.outputs.build-others == 'true' | |
run: corepack pnpm install | |
- name: 'build: qwik-city & others' | |
if: needs.changes.outputs.build-others == 'true' | |
run: pnpm build --tsc --api --qwikcity --cli --qwiklabs --qwikreact --eslint --set-dist-tag="${{ github.event.inputs.disttag }}" | |
- name: 'restore: qwik-city & others' | |
if: needs.changes.outputs.build-others != 'true' | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
packages/qwik-city/lib | |
packages/qwik-labs/lib | |
packages/qwik-labs/vite | |
packages/qwik-react/lib | |
packages/qwik-react/vite | |
packages/eslint-plugin-qwik/dist | |
packages/create-qwik/dist | |
key: ${{ needs.changes.outputs.hash-others }} | |
- name: Print QwikCity Lib Build | |
run: tree packages/qwik-city/lib/ | |
- name: Upload QwikCity Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-qwikcity | |
path: packages/qwik-city/lib/ | |
if-no-files-found: error | |
- name: Print QwikLabs Lib Build | |
run: tree packages/qwik-labs/lib/ packages/qwik-labs/vite/ | |
- name: Upload QwikLabs+React Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-qwiklabs | |
path: | | |
packages/qwik-labs/lib/ | |
packages/qwik-labs/vite/ | |
packages/qwik-labs/package.json | |
if-no-files-found: error | |
- name: Print qwik-react Lib Build | |
run: tree packages/qwik-react/lib/ packages/qwik-react/vite/ | |
- name: Upload qwik-react Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-qwikreact | |
path: | | |
packages/qwik-react/lib/ | |
packages/qwik-react/vite/ | |
packages/qwik-react/package.json | |
if-no-files-found: error | |
- name: Print Create Qwik CLI Dist Build | |
run: tree packages/create-qwik/dist/ | |
- name: Upload Create Qwik CLI Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-create-qwik | |
path: packages/create-qwik/dist/ | |
if-no-files-found: error | |
- name: Print Eslint rules Dist Build | |
run: tree packages/eslint-plugin-qwik/dist/ | |
- name: Upload Eslint rules Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-eslint-plugin-qwik | |
path: packages/eslint-plugin-qwik/dist/ | |
if-no-files-found: error | |
############ BUILD INSIGHTS ############ | |
build-insights: | |
if: always() && needs.changes.outputs.build-insights == 'true' && needs.build-other-packages.result == 'success' | |
name: Build Insights | |
needs: | |
- changes | |
- build-other-packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move Distribution Artifacts | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik/* packages/qwik/dist/ | |
mkdir -p packages/qwik-city/lib/ | |
mv dist-qwikcity/* packages/qwik-city/lib/ | |
mkdir -p packages/create-qwik/dist/ | |
mv dist-create-qwik/* packages/create-qwik/dist/ | |
mkdir -p packages/eslint-plugin-qwik/dist/ | |
mv dist-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/ | |
mv dist-qwiklabs/lib packages/qwik-labs/lib | |
mv dist-qwiklabs/vite packages/qwik-labs/vite | |
- run: corepack pnpm install --frozen-lockfile | |
- name: Build Qwik Insights | |
run: pnpm run build.packages.insights | |
- name: Save Insights Cache | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{ needs.changes.outputs.hash-insights }} | |
path: | | |
packages/insights/dist | |
packages/insights/.netlify | |
############ BUILD DOCS ############ | |
build-docs: | |
if: always() && needs.changes.outputs.build-docs == 'true' && needs.build-other-packages.result == 'success' | |
name: Build Docs | |
needs: | |
- changes | |
- build-other-packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move Distribution Artifacts | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik/* packages/qwik/dist/ | |
mkdir -p packages/qwik-city/lib/ | |
mv dist-qwikcity/* packages/qwik-city/lib/ | |
mkdir -p packages/create-qwik/dist/ | |
mv dist-create-qwik/* packages/create-qwik/dist/ | |
mkdir -p packages/eslint-plugin-qwik/dist/ | |
mv dist-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/ | |
mv dist-qwiklabs/lib packages/qwik-labs/lib | |
mv dist-qwiklabs/vite packages/qwik-labs/vite | |
mv dist-qwikreact/lib packages/qwik-react/lib | |
mv dist-qwikreact/vite packages/qwik-react/vite | |
- run: corepack pnpm install --frozen-lockfile | |
- name: Build Qwik Docs | |
run: pnpm run build.packages.docs | |
- name: Save Docs Cache | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{ needs.changes.outputs.hash-docs }} | |
path: | | |
packages/docs/dist | |
packages/docs/server | |
- name: Cloudflare Pages Deployment | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: 'qwik-docs' | |
directory: packages/docs/dist | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
############ UNIT TEST ############ | |
test-unit: | |
name: Unit Tests | |
if: | | |
always() && ( | |
((needs.changes.outputs.build-qwik == 'true' || | |
needs.changes.outputs.build-others == 'true' || | |
needs.changes.outputs.build-rust == 'true') && | |
needs.build-other-packages.result == 'success' | |
) || | |
github.ref == 'refs/heads/main' | |
) | |
runs-on: ubuntu-latest | |
needs: | |
- changes | |
- build-other-packages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- run: corepack enable | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move Distribution Artifacts | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik/* packages/qwik/dist/ | |
mkdir -p packages/qwik-city/lib/ | |
mv dist-qwikcity/* packages/qwik-city/lib/ | |
mkdir -p packages/create-qwik/dist/ | |
mv dist-create-qwik/* packages/create-qwik/dist/ | |
mkdir -p packages/eslint-plugin-qwik/dist/ | |
mv dist-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/ | |
- run: pnpm install --frozen-lockfile | |
- name: Unit Tests | |
run: pnpm run test.unit | |
############ E2E TEST ############ | |
test-e2e: | |
# Sometimes the tests just hang | |
timeout-minutes: 20 | |
name: E2E Tests | |
if: | | |
always() && ( | |
((needs.changes.outputs.build-qwik == 'true' || | |
needs.changes.outputs.build-others == 'true' || | |
needs.changes.outputs.build-rust == 'true') && | |
needs.build-other-packages.result == 'success' && | |
needs.test-unit.result == 'success' | |
) || | |
github.ref == 'refs/heads/main' | |
) | |
needs: | |
- build-other-packages | |
- changes | |
- test-unit | |
strategy: | |
matrix: | |
settings: | |
- host: ubuntu-latest | |
browser: chromium | |
# too slow and flaky. Perhaps better in v2? | |
# - host: ubuntu-latest | |
# browser: firefox | |
- host: macos-latest | |
browser: webkit | |
- host: windows-latest | |
browser: chromium | |
runs-on: ${{ matrix.settings.host }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- run: corepack enable | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move Distribution Artifacts | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik/* packages/qwik/dist/ | |
mkdir -p packages/qwik-city/lib/ | |
mv dist-qwikcity/* packages/qwik-city/lib/ | |
mkdir -p packages/create-qwik/dist/ | |
mv dist-create-qwik/* packages/create-qwik/dist/ | |
mkdir -p packages/eslint-plugin-qwik/dist/ | |
mv dist-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/ | |
- run: pnpm install --frozen-lockfile | |
- name: Install Playwright | |
run: npx playwright install ${{ matrix.settings.browser }} --with-deps | |
- name: Playwright E2E Tests | |
run: pnpm run test.e2e.${{ matrix.settings.browser }} --timeout 60000 --retries 7 --workers 1 | |
- name: Validate Create Qwik Cli | |
run: pnpm cli.validate | |
########### LINT RUST ############ | |
validate-rust: | |
if: needs.changes.outputs.build-rust == 'true' | |
name: Validate Rust | |
runs-on: ubuntu-latest | |
needs: changes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Format check | |
run: cargo fmt --check | |
- name: Build check | |
run: cargo check --all-features | |
- name: Clippy check | |
run: cargo clippy --all-features | |
- name: Unit tests | |
run: make test | |
########### LINT PACKAGES ############ | |
lint-package: | |
name: Lint Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- run: corepack enable | |
- run: pnpm install --frozen-lockfile | |
- name: Prettier Check | |
if: always() | |
run: pnpm run lint.prettier | |
- name: Build ESLint | |
if: always() | |
run: pnpm build --eslint | |
- name: ESLint Check | |
if: always() | |
run: pnpm run lint.eslint | |
############ Everything is fine ############ | |
requirements-passed: | |
name: All requirements are met | |
runs-on: ubuntu-latest | |
needs: | |
- test-e2e | |
- validate-rust | |
- lint-package | |
if: | | |
always() && | |
(needs.test-e2e.result == 'success' || needs.test-e2e.result == 'skipped') && | |
(needs.validate-rust.result == 'success' || needs.validate-rust.result == 'skipped') && | |
(needs.lint-package.result == 'success' || needs.lint-package.result == 'skipped') | |
steps: | |
- run: echo "All good :-)" | |
############ RELEASE ############ | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- test-e2e | |
- changes | |
# Either one of the packages changed or we need to merge changesets | |
if: | | |
always() && ( | |
github.ref == 'refs/heads/main' || | |
((needs.changes.outputs.build-qwik == 'true' || | |
needs.changes.outputs.build-others == 'true' || | |
needs.changes.outputs.build-rust == 'true') && | |
needs.test-e2e.result == 'success' | |
) | |
) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'pnpm' | |
registry-url: https://registry.npmjs.org/ | |
- run: corepack enable | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move Distribution Artifacts | |
run: | | |
mkdir -p packages/qwik/dist/ | |
mv dist-qwik/* packages/qwik/dist/ | |
mkdir -p packages/qwik-city/lib/ | |
mv dist-qwikcity/* packages/qwik-city/lib/ | |
mkdir -p packages/create-qwik/dist/ | |
mv dist-create-qwik/* packages/create-qwik/dist/ | |
mkdir -p packages/eslint-plugin-qwik/dist/ | |
mv dist-eslint-plugin-qwik/* packages/eslint-plugin-qwik/dist/ | |
mv dist-qwiklabs/lib packages/qwik-labs/lib | |
mv dist-qwiklabs/vite packages/qwik-labs/vite | |
mv dist-qwikreact/lib packages/qwik-react/lib | |
mv dist-qwikreact/vite packages/qwik-react/vite | |
- run: pnpm install --frozen-lockfile | |
- name: Save qwik cache | |
if: needs.changes.outputs.build-qwik == 'true' | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{ needs.changes.outputs.hash-qwik }} | |
path: packages/qwik/dist | |
- name: Save rust cache | |
if: needs.changes.outputs.build-rust == 'true' | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{ needs.changes.outputs.hash-rust }} | |
path: packages/qwik/dist/bindings | |
- name: Save others cache | |
if: needs.changes.outputs.build-others == 'true' | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{ needs.changes.outputs.hash-others }} | |
path: | | |
packages/qwik-city/lib | |
packages/qwik-labs/lib | |
packages/qwik-labs/vite | |
packages/qwik-react/lib | |
packages/qwik-react/vite | |
packages/eslint-plugin-qwik/dist | |
packages/create-qwik/dist | |
- name: Commit Build Artifacts | |
if: github.event_name == 'push' | |
env: | |
QWIK_API_TOKEN_GITHUB: ${{ secrets.QWIK_API_TOKEN_GITHUB }} | |
run: pnpm run qwik-save-artifacts | |
- name: Publish packages for testing | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
run: pnpm dlx pkg-pr-new@^0.0.9 publish --compact --pnpm ./packages/qwik/dist ./packages/qwik-city/lib ./packages/eslint-plugin-qwik/dist ./packages/create-qwik/dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release Pull Request or Publish to npm | |
if: github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish manually | |
if: github.event_name == 'workflow_dispatch' | |
run: pnpm build --set-dist-tag="${{ github.event.inputs.disttag }}" --validate --release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
############ TRIGGER QWIKCITY E2E TEST ############ | |
trigger-qwikcity-e2e: | |
name: Trigger Qwik City E2E | |
runs-on: ubuntu-latest | |
needs: | |
- changes | |
- release | |
if: always() && (needs.changes.outputs.build-qwik == 'true' || needs.changes.outputs.build-rust == 'true' || needs.changes.outputs.build-others == 'true') && needs.release.result == 'success' && github.ref_name == 'main' | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} | |
repository: builderIO/qwik-city-e2e | |
event-type: main-updated |