Skip to content

Commit

Permalink
chore(ci): use gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
taye authored and interactjs-ci committed Apr 7, 2022
1 parent fe36afc commit 90d3baf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -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}}
6 changes: 6 additions & 0 deletions scripts/bin/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let packages
main().catch(errorExit)

async function main (ps) {
configGitUser()
gitDetatch()

clean()
Expand All @@ -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 {
Expand Down

0 comments on commit 90d3baf

Please sign in to comment.