diff --git a/.github/funding.yml b/.github/funding.yml new file mode 100644 index 0000000..7e63900 --- /dev/null +++ b/.github/funding.yml @@ -0,0 +1 @@ +github: sergiodxa diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..8e73ab2 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + categories: + - title: New Features + labels: + - enhancement + - title: Documentation Changes + labels: + - documentation + - title: Bug Fixes + labels: + - bug + - title: Deprecations + labels: + - deprecated + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..1414408 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,39 @@ +name: Bump version + +on: + workflow_dispatch: + inputs: + version: + description: "Semver type of new version (major / minor / patch)" + required: true + type: choice + options: + - major + - minor + - patch + +jobs: + bump-version: + name: Bump version + runs-on: ubuntu-latest + steps: + - name: Check out source + uses: actions/checkout@v2 + with: + ssh-key: ${{ secrets.DEPLOY_KEY }} + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "16" + cache: "npm" + - name: Install dependencies + uses: bahmutov/npm-install@v1 + - name: Setup Git + run: | + git config user.name 'Sergio Xalambrí' + git config user.email 'hello@sergiodxa.com' + - name: bump version + run: npm version ${{ github.event.inputs.version }} + + - name: Push latest version + run: git push origin main --follow-tags diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dbfa8e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: CI + +on: [push] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node LTS + uses: actions/setup-node@v2 + with: + node-version: "lts/*" + + - name: Install dependencies + uses: bahmutov/npm-install@v1 + + - name: Build + run: npm run build + + typecheck: + name: Typechecker + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node LTS + uses: actions/setup-node@v2 + with: + node-version: "lts/*" + + - name: Install dependencies + uses: bahmutov/npm-install@v1 + + - name: Typecheck + run: npm run typecheck + + test: + name: Unit and Integration Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node LTS + uses: actions/setup-node@v2 + with: + node-version: "lts/*" + + - name: Install dependencies + uses: bahmutov/npm-install@v1 + + - name: Test + run: npm run test -- --coverage + + lint: + name: Linter + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node LTS + uses: actions/setup-node@v2 + with: + node-version: "lts/*" + + - name: Install dependencies + uses: bahmutov/npm-install@v1 + + - name: Lint + run: npm run lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5fffd85 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish-npm: + name: "Publish to npm" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - uses: actions/setup-node@v2 + with: + node-version: "lts/*" + registry-url: https://registry.npmjs.org/ + + - run: npm install + + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}