From 90d3baf948a03b2fae65c2d73f752f3086b11912 Mon Sep 17 00:00:00 2001 From: Taye Adeyemi Date: Thu, 7 Apr 2022 02:33:46 +0200 Subject: [PATCH] chore(ci): use gh actions --- .github/workflows/workflow.yml | 41 ++++++++++++++++++++++++++++++++++ scripts/bin/release.js | 6 +++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 000000000..201f228f9 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,41 @@ +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@v3 + 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}} diff --git a/scripts/bin/release.js b/scripts/bin/release.js index 7d2dd866a..c46eadd31 100644 --- a/scripts/bin/release.js +++ b/scripts/bin/release.js @@ -20,6 +20,7 @@ let packages main().catch(errorExit) async function main (ps) { + configGitUser() gitDetatch() clean() @@ -32,6 +33,11 @@ async function main (ps) { await pushAndPublish() } +function configGitUser () { + shell.exec('git config user.name "CI"') + shell.exec('git config user.email "<>"') +} + function ensureCleanIndex () { // make sure the repo is clean try {