From d3d474610c114af5a09fa5f70458f12075c13ffb Mon Sep 17 00:00:00 2001 From: Taye Adeyemi Date: Thu, 28 Mar 2024 21:39:34 +0100 Subject: [PATCH] chore: update github workflows --- .github/workflows/publish.yml | 28 +++++++++++++++++++++++ .github/workflows/test.yml | 20 +++++++++++++++++ .github/workflows/workflow.yml | 41 ---------------------------------- 3 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..3dc13be0a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +on: + push: + branches: + - main + - next + +jobs: + test: + uses: ./.github/workflows/test.yml + + publish-npm: + name: '๐Ÿ“ฆ Build and Publish ๐Ÿš€' + needs: [test] + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: https://registry.npmjs.org/ + cache: yarn + - name: โš™ bootstrap + run: 'npm run bootstrap && git fetch --tags' + - name: ๐Ÿ“ฆ build and publish ๐Ÿš€ + run: npx _release + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..bf05e68af --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +on: + pull_request: + workflow_dispatch: + workflow_call: + +jobs: + test: + name: '๐Ÿงช Test' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ianwalter/playwright-container@43940dfa7d309fe3569b9df407ae9e84dcbf2e7f + - name: โš™ bootstrap + run: 'npm run bootstrap && npx _check_deps && npx _add_plugin_indexes' + - name: ๐Ÿ“ types + run: npx tsc -b -f + - name: ๐Ÿ” lint + run: npx _lint + - name: ๐Ÿงช tests + run: npm test diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml deleted file mode 100644 index 3297fcbb8..000000000 --- a/.github/workflows/workflow.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Workflow - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - test: - name: '๐Ÿงช Test' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ianwalter/playwright-container@43940dfa7d309fe3569b9df407ae9e84dcbf2e7f - - name: โš™ bootstrap - run: 'npm run bootstrap && npx _check_deps && npx _add_plugin_indexes' - - name: ๐Ÿ“ types - run: npx tsc -b -f - - name: ๐Ÿ” lint - run: npx _lint - - name: ๐Ÿงช tests - run: npm test - - publish-npm: - name: '๐Ÿ“ฆ Build and Publish ๐Ÿš€' - if: ${{ github.repository == 'taye/interact.js' && (github.ref_name == 'latest' || github.ref_name == 'next') }} - needs: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v4 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - cache: yarn - - name: โš™ bootstrap - run: 'npm run bootstrap && git fetch --tags' - - name: ๐Ÿ“ฆ build and publish ๐Ÿš€ - run: npx _release - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}}