diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a548558 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: CI +on: + pull_request: + push: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - uses: pnpm/action-setup@v2 + with: + version: 7 + + - run: pnpm install + + - run: pnpm format:check + + - run: pnpm lint + + - run: pnpm test + + - uses: codecov/codecov-action@v3 + + - run: pnpm build \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d26b7a1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Version and Release + +on: + workflow_dispatch: + inputs: + newversion: + description: 'Version' + required: true + +concurrency: + group: npm-bump + cancel-in-progress: true + +jobs: + version_and_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + + - uses: pnpm/action-setup@v2 + id: pnpm-install + with: + version: 7 + + - run: pnpm install + + - run: pnpm test + + - uses: bcomnes/npm-bump@v2 + with: + git_email: github-actions@github.com + git_username: github-actions + newversion: ${{ github.event.inputs.newversion }} + push_version_commit: true + github_token: ${{ secrets.GITHUB_TOKEN }} + npm_token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f0460e2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -node_js: 18 -cache: - npm: false - directories: - - "~/.pnpm-store" -before_install: - - curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7 - - pnpm config set store-dir ~/.pnpm-store -install: - - pnpm install -script: - - pnpm format:check - - pnpm lint - - pnpm test -after_success: - - npx codecov diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1754369..2d2d24c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: 5.4 specifiers: - '@vitest/coverage-c8': ^0.26.2 + '@vitest/coverage-c8': 0.26.2 eslint-config-unicorn-camelcase: 0.1.1 flux-standard-action: 2.1.2 husky: 8.0.2