diff --git a/.github/workflows/pr_test.yaml b/.github/workflows/pr_test.yaml index 866d0fb..f913ca1 100644 --- a/.github/workflows/pr_test.yaml +++ b/.github/workflows/pr_test.yaml @@ -1,12 +1,12 @@ -name: PR Tests +name: Tests on: push: - branches: [ pipfile-experiment,readme-update2 ] + branches: [pipfile-experiment] + tag: ['*'] pull_request: + branches: [pipfile-experiment] types: [opened, synchronize, reopened] - - jobs: build: runs-on: ubuntu-latest @@ -28,3 +28,21 @@ jobs: pipenv install pytest pipenv --venv pipenv run python -m pytest + deliver: + if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/') + needs: [build] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - name: Install Python, pipenv and Pipfile packages + uses: kojoru/prepare-pipenv@v1 + - name: Build package + run: | + pipenv install build + pipenv run python -m build . + - name: Publish to PyPI test server + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ diff --git a/Pipfile b/Pipfile index 6d47a21..2fe7f57 100644 --- a/Pipfile +++ b/Pipfile @@ -11,7 +11,7 @@ build = "*" twine = "*" [requires] -python_version = "3.12" +python_version = "3.9" [scripts] snacktime = "python -m snacktime" diff --git a/ci.yml b/ci.yml deleted file mode 100644 index 8340bfd..0000000 --- a/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [ "3.10", "3.12" ] - - steps: - - name: Check out repo - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install package and test deps - run: | - python -m pip install --upgrade pip - pip install -e . pytest - - - name: Run tests - run: pytest -q