chore(deps): update js-devtools/npm-publish action to v2 - autoclosed #5246
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ^7 | |
- name: Set node version to 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-07-03 | |
profile: minimal | |
override: true | |
target: wasm32-wasi | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
packages/swc | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build packages | |
run: pnpm run build | |
- name: Pack packages | |
run: pnpm run pack | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: | | |
./ | |
!.git/ | |
!**/node_modules/ | |
!packages/swc/target/ | |
packages/swc/target/wasm32-wasi/release/import_meta_env_swc.wasm | |
!packages/examples/ | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ^7 | |
- name: Set node version to 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-07-03 | |
profile: minimal | |
override: true | |
target: wasm32-wasi | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
packages/swc | |
- name: Install dependencies | |
run: | | |
pnpm i | |
rustup component add rustfmt | |
- name: Check formatting | |
run: pnpm run lint | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm@7 | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ^7 | |
- name: Set node version to 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2023-07-03 | |
profile: minimal | |
override: true | |
target: wasm32-wasi | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
packages/swc | |
- name: Install dependencies | |
run: pnpm i | |
- name: Test packages | |
run: pnpm run test | |
npm-node-18-examples: | |
needs: | |
- build | |
- lint | |
- test | |
name: "Test example - ${{ matrix.example }}" | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: full | |
strategy: | |
matrix: | |
example: | |
- "@vue+cli@5-example" | |
- "angular-example" | |
- "babel-starter-example" | |
- "compatibility-example" | |
- "create-next-app-example" | |
- "create-react-app-example" | |
- "create-vue-app-example" | |
- "cypress-example" | |
- "docker-compose-starter-example" | |
- "docker-starter-example" | |
- "esbuild-starter-example" | |
- "jest-example" | |
- "mocha-example" | |
# - "nuxt-bridge-example" | |
- "nx-react-example" | |
- "process-env-example" | |
- "rollup-plugin-babel-example" | |
- "rollup-starter-example" | |
- "rollup-swc-example" | |
- "swc-example" | |
- "vite-alpine-example" | |
- "vite-built-in-import-meta-env-example" | |
- "vite-config-build-assets-dir-example" | |
- "vite-config-build-out-dir-example" | |
- "vite-legacy-example" | |
- "vite-preact-example" | |
# - "vite-qwik-example" | |
- "vite-react-example" | |
- "vite-solid-example" | |
- "vite-starter-example" | |
- "vite-svelte-example" | |
- "vite-swc-example" | |
- "vite-vanilla-example" | |
- "vite-vanilla-ts-example" | |
- "vite-vue-jsx-example" | |
- "vite-vue-ts-example" | |
- "vitest-example" | |
- "webpack-module-federation-example" | |
- "webpack-babel-loader-example" | |
- "webpack-starter-example" | |
- "webpack-swc-example" | |
- "webpack-ts-loader-example" | |
- "worker-example" | |
include: | |
- os: ubuntu-latest | |
node_version: 18 | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
- name: Set node version to ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Test diff | |
run: | | |
cd packages/examples | |
npm i | |
cd ../../diff/after-using-import-meta-env | |
npm i | |
npm run _test | |
- name: Test ${{ matrix.example }} | |
run: | | |
cd packages/examples | |
npm i | |
cd ${{ matrix.example }} | |
npm i | |
npm run _test | |
npm-node-16-examples: | |
needs: | |
- build | |
- lint | |
- test | |
name: "Test example - ${{ matrix.example }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
example: | |
- "@vue+cli@4-example" | |
- "create-nuxt-app-example" | |
include: | |
- os: ubuntu-latest | |
node_version: 16 | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
- name: Set node version to ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Test ${{ matrix.example }} | |
run: | | |
cd packages/examples | |
npm i | |
cd ${{ matrix.example }} | |
npm i | |
npm run _test | |
release: | |
name: Release | |
needs: | |
- build | |
- lint | |
- test | |
- npm-node-18-examples | |
- npm-node-16-examples | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: | |
- babel | |
- cli | |
- flow | |
- prepare | |
- swc | |
- typescript | |
- unplugin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ^7 | |
- name: Set node version to 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: Publish | |
uses: JS-DevTools/npm-publish@v2 | |
id: publish | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: packages/${{ matrix.package }}/package.json | |
tag: latest | |
access: public | |
dry-run: ${{ github.ref_name != 'main' }} | |
check-version: true | |
greater-version-only: true | |
- name: Tag | |
uses: anothrNick/github-tag-action@v1 | |
if: steps.publish.outputs.type != 'none' | |
env: | |
DRY_RUN: ${{ github.ref_name != 'main' }} | |
CUSTOM_TAG: ${{ matrix.package }}${{ steps.publish.outputs.version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{github.ref_name == 'main' && steps.publish.outputs.type != 'none'}} | |
with: | |
tag_name: ${{ matrix.package }}${{ steps.publish.outputs.version }} | |
body: "Changelog: https://github.com/iendeavor/import-meta-env/blob/${{ matrix.package }}${{ steps.publish.outputs.version }}/packages/${{ matrix.package }}/CHANGELOG.md" | |
docs: | |
name: Docs | |
needs: | |
- build | |
- lint | |
- test | |
- npm-node-18-examples | |
- npm-node-16-examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ^7 | |
- name: Install dependencies | |
run: pnpm i | |
- name: Build docs | |
run: pnpm run docs:build | |
- name: Commit files | |
run: | | |
cd docs/.vitepress/dist | |
git init | |
git branch -m gh-pages | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -m "docs: deploy" | |
- name: Push docs | |
if: github.ref_name == 'main' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
directory: docs/.vitepress/dist | |
force: true |