diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..2a5bc46 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: deploy to pypi + +on: + workflow_dispatch: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + deploy: + name: deploy + permissions: + id-token: write + environment: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: install build dependencies + run: python3 -m pip install build + + - name: build package + run: python3 -m build --sdist --wheel --outdir dist/ + + - name: upload package + uses: actions/upload-artifact@v4 + with: + name: package + path: dist/ + + - name: publish package (pypi) + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: "https://pypi.org/legacy/" + + - name: publish package (test.pypi) + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: "https://test.pypi.org/legacy/" diff --git a/.github/workflows/ci-test.yml b/.github/workflows/test.yml similarity index 50% rename from .github/workflows/ci-test.yml rename to .github/workflows/test.yml index 7442528..f1a96c0 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,8 @@ -name: Run CI tests +name: run CI test on: push: - branches: - - main - - master + branches: [devel, main, master, wip] pull_request: env: @@ -17,23 +15,18 @@ jobs: strategy: fail-fast: false matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - - name: "checkout repository" - uses: actions/checkout@v3 - - - name: "setup python 3.9" - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 - - - name: "setup python 3.11" - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.11 - - name: install nox + - name: install requirements run: python -m pip install nox - name: run tests