diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 1389a85a..69f530a7 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -1,15 +1,38 @@ -name: build -description: Check that all packages build successfully +name: Prepare +description: Install dependencies and build the platform +inputs: + build: + description: Build the production bundle of the platform + required: false + default: 'true' + registry: + description: NPM registry to set up for auth + required: false + default: 'https://registry.npmjs.org' + runs: using: composite steps: + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + - name: Install Node.js uses: actions/setup-node@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v4.0.0 + with: + node-version-file: package.json + registry-url: ${{ inputs.registry }} + cache: pnpm + + - name: Update npm + shell: bash + run: npm install -g npm@latest + - name: Install dependencies shell: bash run: pnpm install + - name: Build if: inputs.build == 'true' shell: bash diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ed208ef2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + push: + branches: + - main + pull_request: # temporary to test the action + branches: + - main + +permissions: + id-token: write + contents: read + +jobs: + publish: + name: Publish Packages + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Prepare + uses: ./.github/actions/prepare + + - name: Publish packages to NPM + env: + NPM_CONFIG_PROVENANCE: true + run: | + node -v + npm -v + pnpm --filter "./packages/*" --recursive publish \ + --access=public \ + --no-git-checks \ + --dry-run diff --git a/package.json b/package.json index 31c6cbdb..be50ff98 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "homepage": "https://github.com/directus-labs/extensions", "engines": { - "node": ">=18.18.0", + "node": "22", "pnpm": "~9" }, "directus:meta": {