From 33cc72a6f6d4c16c5d8792f0b6ca5bcf88649f5c Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Thu, 22 Dec 2022 12:20:19 +0100 Subject: [PATCH] Added GH workflows --- .github/pull_request_template.md | 20 ++++++++++++++++++++ .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ .github/workflows/pull-request.yml | 23 +++++++++++++++++++++++ .github/workflows/version.yml | 27 +++++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/version.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b0907e2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +**Thank you for submitting this pull request** + +fix _(please add the issue ID if it exists)_ + +### Referenced pull requests + + + + +### Checklist +- [ ] Documentation updated if applicable. +- [ ] Changelog updated if applicable. + +> **Note:** `dist/cli/index.js` and `dist/gha/index.js` are automatically generated by git hooks and gh workflows. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..18723db --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + tag: + description: 'publish the package with the specified tag, default is "latest"' + required: false + default: 'latest' + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm install + - run: npm publish --access public --tag ${{ inputs.tag }} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..4d482ef --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,23 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Pull Request Checks + +on: pull_request + +jobs: + build: + strategy: + matrix: + node-version: [16] + os: [ubuntu-latest] + fail-fast: false + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Setup Node ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci \ No newline at end of file diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..1e22d64 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,27 @@ +# This manual workflow will bump the project to a new version and tag it, see https://docs.npmjs.com/cli/v8/commands/npm-version#description for more details + +name: Version Tag + +on: + workflow_dispatch: + inputs: + version: + description: 'version to bump [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]' + required: false + default: 'minor' + type: string + message: + description: 'version commit message to be used' + required: false + default: 'Bumping to version %s' + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm version ${{ inputs.version }} -m "${{ inputs.message }}"