diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000..488f778 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,25 @@ +name: Prerelease + +on: + pull_request: + +jobs: + prerelease: + name: Prerelease + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 18.x + - name: Install dependencies + run: npx ci + - name: Install semantic-release extra plugins + run: npm install --save-dev @semantic-release/changelog @semantic-release/git + - name: Lint + run: npm run lint-fix + - name: Test + run: npm run test:unit --if-present \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 609ae3b..315f6ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ on: branches: - main - beta - pull_request: jobs: release: @@ -13,22 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 18.x - - name: Install dependencies - run: npx ci - - name: Install semantic-release extra plugins - run: npm install --save-dev @semantic-release/changelog @semantic-release/git - - name: Lint - run: npm run lint-fix - - name: Test - run: npm run test:unit --if-present + - name: Prerelease + uses: ./.github/workflows/prerelease - name: Release - if: github.event_name == 'pull_request' && github.event.pull_request.merged == true && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}