-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update supported Python versions + add workflows
- Loading branch information
Showing
6 changed files
with
170 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: RtD Docs Preview | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
documentation-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: readthedocs/actions/preview@v1 | ||
with: | ||
project-slug: "utctime" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Release to PyPI / TestPyPi | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "0.*" | ||
- "1.*" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
run: | | ||
pip install "tox>=4.5,<4.6" | ||
- name: Run tox | ||
run: | | ||
tox --colored no --quiet | ||
dist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
- name: Install build tools | ||
run: python -m pip install build | ||
- name: Build source and wheel distribution | ||
run: python -m build --sdist --wheel --outdir dist/ | ||
- name: Upload distribution artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
verify-dist: | ||
runs-on: ubuntu-latest | ||
needs: dist | ||
steps: | ||
- name: Download dist artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Verify dist files exist | ||
run: ls dist/* | ||
- name: Validate wheel distribution data | ||
run: python -m zipfile --list dist/*.whl | grep --extended-regexp --silent 'utctime/__init__.py' | ||
|
||
upload-to-testpypi: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- verify-dist | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/utctime | ||
steps: | ||
- name: Download dist artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Publish distribution to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
upload-to-pypi: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- verify-dist | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/utctime | ||
steps: | ||
- name: Download dist artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_url: https://upload.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: ["*"] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
run: | | ||
pip install "tox>=4.5,<4.6" | ||
- name: Run tox | ||
run: | | ||
tox --colored no --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
3.7 | ||
3.8 | ||
3.9 | ||
3.10 | ||
3.11 | ||
3.12 | ||
3.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters