From a270c78ab1a31a2f307c10c4f2c8ca5fd51e0fdd Mon Sep 17 00:00:00 2001 From: Maxwell Brown Date: Thu, 5 Sep 2024 15:02:38 -0400 Subject: [PATCH] add snapshot CI job --- .github/actions/setup/action.yml | 21 ++++++++++ .github/workflows/ci.yml | 56 ------------------------- .github/workflows/snapshot.yml | 23 ++++++++++ packages/create-effect-app/package.json | 5 ++- 4 files changed, 48 insertions(+), 57 deletions(-) create mode 100644 .github/actions/setup/action.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/snapshot.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..80912e9 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,21 @@ +name: Setup +description: Perform standard setup and install dependencies using pnpm. +inputs: + node-version: + description: The version of Node.js to install + required: true + default: 20.14.0 + +runs: + using: composite + steps: + - name: Install pnpm + uses: pnpm/action-setup@v3 + - name: Install node + uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: ${{ inputs.node-version }} + - name: Install dependencies + shell: bash + run: pnpm install \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b50d663..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: ci - -on: - push: - branches: ['**'] - pull_request: - branches: ['**'] - -jobs: - starter-vite-tsc: - strategy: - matrix: - node-version: [16, 18, 20] - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - run: pnpm install - working-directory: starter-vite-tsc - - run: pnpm tsc - working-directory: starter-vite-tsc - - run: pnpm build - working-directory: starter-vite-tsc - - node-scripts: - strategy: - matrix: - node-version: [16, 18, 20] - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - run: pnpm install - working-directory: node-scripts - - run: pnpm tsc - working-directory: node-scripts - - run: pnpm tsx src/fs-write-file.ts - working-directory: node-scripts - - run: pnpm tsx src/async-promises.ts - working-directory: node-scripts diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..1c3917d --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,23 @@ +name: Snapshot + +on: + pull_request: + branches: [main] + +permissions: {} + +jobs: + snapshot: + name: Snapshot + if: github.repository_owner == 'Effect-Ts' + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/setup + - name: Build package + run: pnpm build + - name: Create snapshot + id: snapshot + run: pnpx pkg-pr-new@0.0.24 publish --pnpm --comment=off ./packages/* \ No newline at end of file diff --git a/packages/create-effect-app/package.json b/packages/create-effect-app/package.json index 680cc23..9457ef8 100644 --- a/packages/create-effect-app/package.json +++ b/packages/create-effect-app/package.json @@ -4,6 +4,9 @@ "type": "module", "license": "MIT", "description": "Create Effect-powered applications with a single command", + "bin": { + "create-effect-app": "./dist/bin.cjs" + }, "engines": { "node": ">=20.14.0" }, @@ -35,4 +38,4 @@ "tar": "^7.4.3", "tsup": "^8.2.4" } -} +} \ No newline at end of file