From 21ec2f9a7ac67aa7c8cd88aaedd1a1469cadece3 Mon Sep 17 00:00:00 2001 From: xeuxdev Date: Tue, 3 Oct 2023 15:46:36 +0100 Subject: [PATCH] modify workflow --- .github/workflows/release.yml | 39 ++++++++++++++--------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f03d97..c3c9850 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,12 @@ -name: Release easymailer package to NPM - +name: Publish on: - release: - types: [created, edited, published] workflow_run: - workflows: [CI] + workflows: [Main] branches: [main] types: [completed] + push: + branches: + - "main" concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -15,32 +15,25 @@ permissions: pull-requests: write jobs: - release: - name: Release + publish: + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - - name: Setup pnpm 7 - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 with: version: 7 - - - name: Setup Node.js 18.x - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: - node-version: 18.x - - - name: Install Dependencies - run: pnpm i + node-version: 16.x + cache: "pnpm" - - name: Create Release Pull Request or Publish to npm + - run: pnpm install --frozen-lockfile + - name: Create Release Pull Request or Publish id: changesets uses: changesets/action@v1 with: - # This expects you to have a script called release which does a build for your packages and calls changeset publish - publish: pnpm release + publish: pnpm run release env: - GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}