diff --git a/.github/workflows/dev-packages.yaml b/.github/workflows/dev-packages.yaml deleted file mode 100644 index 45432df..0000000 --- a/.github/workflows/dev-packages.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Action to publish packages under the `next` tag for testing -# Packages are versioned as `0.0.0-{tag}-DATETIMESTAMP` -name: Create Dev Release - -on: - push: - branches: - - '**' - - '!main' # excludes main, this is handled by changesets - tags-ignore: - - '**' - -jobs: - publish: - name: Publish Dev Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Setup NodeJS - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 9 - run_install: false - - name: Add NPM auth - run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - name: Install dependencies - run: pnpm install - - name: Version packages - run: pnpm changeset version --no-git-tag --snapshot dev - - name: Publish - run: pnpm changeset publish --tag dev \ No newline at end of file diff --git a/.github/workflows/release-packages.yaml b/.github/workflows/release-packages.yaml index bec8a58..5b85677 100644 --- a/.github/workflows/release-packages.yaml +++ b/.github/workflows/release-packages.yaml @@ -4,59 +4,58 @@ on: push: branches: - main + workflow_dispatch: # For dev publishing concurrency: ${{ github.workflow }}-${{ github.ref }} +permissions: + id-token: write # Required for OIDC / trusted publishing + contents: write # Required for changesets pushing commits + pull-requests: write # Required for changesets creating PRs + jobs: release-packages: name: Release Packages runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 + - name: Enable Corepack + run: corepack enable - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version-file: '.nvmrc' - - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 9 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Add NPM auth - run: | - echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc + cache: pnpm - name: Install dependencies run: pnpm install + - name: Update npm + run: | + npm install -g npm@latest + npm --version - name: Create Release Pull Request or Publish to npm id: changesets uses: changesets/action@v1 + if: ${{ github.event_name == 'push' }} with: # This expects you to have a script called release which does a build for your packages and calls changeset publish publish: pnpm release version: pnpm changeset version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Debug Outputs + if: ${{ github.event_name == 'push' }} run: | - echo "Published Packages: ${{ steps.changesets.outputs.publishedPackages }}" \ No newline at end of file + echo "Published Packages: ${{ steps.changesets.outputs.publishedPackages }}" + + - name: Dev publish + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + pnpm changeset version --no-git-tag --snapshot dev + pnpm changeset publish --tag dev + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec1ba99..fbca0c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,9 +15,9 @@ jobs: mysql-version: [ 8.0, 8.4 ] steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false + - uses: actions/checkout@v5 + - name: Enable Corepack + run: corepack enable - name: Start MySQL run: | @@ -29,31 +29,13 @@ jobs: --log-bin=/var/lib/mysql/mysql-bin.log - name: Setup NodeJS - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version-file: '.nvmrc' - - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 9 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + cache: pnpm - name: Install dependencies run: pnpm install - name: Test - run: pnpm test \ No newline at end of file + run: pnpm test diff --git a/.nvmrc b/.nvmrc index 517f386..b09ba46 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v22.14.0 +v22.21.0 diff --git a/package.json b/package.json index 2bba0ac..f8078dc 100644 --- a/package.json +++ b/package.json @@ -47,5 +47,6 @@ "big-integer": "1.6.52", "iconv-lite": "0.6.3", "@vlasky/mysql": "^2.18.6" - } + }, + "packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8" }