diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..77497cd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: build + +on: + push: + pull_request: + +env: + PIP_ROOT_USER_ACTION: ignore + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: install dependencies + run: pip install -e .[dev] + + - name: lint + run: make lint + + - name: test + run: make test + + release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - run: python -m pip install build + - run: python -m build --sdist --wheel --outdir dist/ . + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + + - name: Create Github Release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 1cd475b..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: publish to pypi - -on: - workflow_dispatch: - release: - types: [created] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - - run: python -m pip install build - - run: python -m build --sdist --wheel --outdir dist/ . - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml deleted file mode 100644 index ce6dbf1..0000000 --- a/.github/workflows/stale-issues.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: close stale issues - -permissions: - issues: write - pull-requests: write - -on: - workflow_dispatch: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' - days-before-stale: 120 - days-before-close: 14 - exempt-all-pr-milestones: true - exempt-issue-labels: 'todo' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 5ab24ef..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: test - -on: - push: - pull_request: - -env: - PIP_ROOT_USER_ACTION: ignore - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: install dependencies - run: pip install -e .[dev] - - - name: lint - run: make lint - - - name: test - run: make test