diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..639b999 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: ci + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: 🐍 Setup Python + uses: actions/setup-python@v2 + # with: + # python-version: '3.9.4' + + - name: Install PIP dependencies + run: pip3 install -r requirements.txt + + - name: Run tests + run: python3 -m unittest + + release: + runs-on: ubuntu-latest + needs: test + if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request'}} + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + id: semantic + with: + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + conventional-changelog-conventionalcommits + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..02e3331 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,25 @@ +{ + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "chore", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + "@semantic-release/changelog", + "@semantic-release/git", + "@semantic-release/github" + ] +}