diff --git a/.github/workflows/dev-package.yml b/.github/workflows/dev-package.yml deleted file mode 100644 index e285f38..0000000 --- a/.github/workflows/dev-package.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Dev Packages - -on: workflow_dispatch -env: - SECRETS: ${{ toJSON(secrets) }} - GITHUB_TOKEN: ${{ secrets.SHARED_GH_TOKEN }} - -jobs: - build: - name: Create Development Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{github.event.pull_request.head.sha}} - fetch-depth: 0 - - - uses: actions/checkout@v4 - with: - repository: journeyapps-platform/ci-actions - token: ${{ secrets.SHARED_GH_TOKEN }} - path: .github/ci - ref: v1 - - - name: Setup NodeJS - uses: actions/setup-node@v4 - with: - node-version: 22.16 - - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 10 - - - - name: Install Dependencies - uses: ./.github/ci/actions/npm-install - with: - client: pnpm - - - name: Has changesets - uses: bluwy/detect-changesets-action@v1 - id: detect - - - name: Build - run: pnpm build - - - name: Publish dev packages. - if: ${{ success() }} - uses: ./.github/ci/actions/pnpm-publish - with: - dev: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index a109c56..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Build and Publish -on: - workflow_dispatch: - push: - branches: - - "**" - tags-ignore: - - "**" - -env: - SECRETS: ${{ toJSON(secrets) }} - GITHUB_TOKEN: ${{ secrets.SHARED_GH_TOKEN }} - -jobs: - build: - name: Publish Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{github.event.pull_request.head.sha}} - fetch-depth: 0 - - - uses: actions/checkout@v4 - with: - repository: journeyapps-platform/ci-actions - token: ${{ secrets.SHARED_GH_TOKEN }} - path: .github/ci - ref: v1 - - - name: Setup NodeJS - uses: actions/setup-node@v4 - with: - node-version: 22.16 - - - uses: pnpm/action-setup@v4 - name: Install pnpm - with: - version: 10 - - - name: Install Dependencies - uses: ./.github/ci/actions/npm-install - with: - client: pnpm - - - - name: Has changesets - uses: bluwy/detect-changesets-action@v1 - id: detect - - - name: Build - run: pnpm build - - - name: Create Release Pull Request or Publish to npm - if: ${{ github.ref == 'refs/heads/master' && steps.detect.outputs.has-changesets == 'true' }} - id: changesets - uses: changesets/action@v1.4.1 - with: - version: pnpm ci:version - commit: "chore: update versions" - title: "[Chore] update versions" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish production packages. - if: ${{ github.ref == 'refs/heads/master' && steps.detect.outputs.has-changesets == 'false' && success() }} - run: | - pnpm ci:publish \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2a5b662 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Release + +on: + push: + branches: [master] + 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 + +env: + SECRETS: ${{ toJSON(secrets) }} + GITHUB_TOKEN: ${{ secrets.SHARED_GH_TOKEN }} + +jobs: + build: + name: Publish Packages + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v5 + + - name: Enable Corepack + run: corepack enable + + - name: Setup NodeJS + uses: actions/setup-node@v6 + with: + node-version-file: ".nvmrc" + cache: pnpm + + + - name: Update npm + run: | + npm install -g npm@latest + npm --version + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + + - name: Build + run: pnpm build + +# - name: Create Release Pull Request or Publish to npm +# id: changesets +# uses: changesets/action@v1 +# if: ${{ github.event_name == 'push' }} +# with: +# version: pnpm ci:version +# publish: pnpm ci:publish +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - 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 }} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yml similarity index 95% rename from .github/workflows/test.yaml rename to .github/workflows/test.yml index 34a3132..0d77d9f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v4 with: - node-version: 22.16 + node-version-file: '.nvmrc' - uses: pnpm/action-setup@v4 name: Install pnpm