-
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.
Merge pull request #4 from mnbf9rca/chore/build_publish_workflow
create single workflow for build, test, publish
- Loading branch information
Showing
7 changed files
with
96 additions
and
24 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
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,70 @@ | ||
name: Publish the completed package to Pypi | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# permissions: # Global permissions configuration starts here | ||
# contents: read # 'read' access to repository contents | ||
# pull-requests: read # 'write' access to pull requests | ||
|
||
jobs: | ||
codeql: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
uses: ./.github/workflows/codeql.yml | ||
|
||
test: | ||
uses: ./.github/workflows/test-workflow.yml | ||
|
||
dependency-review: | ||
uses: ./.github/workflows/dependency-review.yml | ||
|
||
publish: | ||
needs: [test, dependency-review, codeql] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: 'published' | ||
permissions: # Job-level permissions configuration starts here | ||
contents: write # 'write' access to repository contents | ||
pull-requests: write # 'write' access to pull requests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b # v1 | ||
with: | ||
version: 1.8.3 # pin the version as they keep changing their APIs | ||
virtualenvs-create: false | ||
virtualenvs-in-project: false | ||
- name: Install dependencies | ||
run: | | ||
python -m venv venv | ||
. venv/bin/activate | ||
poetry install --with dev --no-interaction --sync | ||
python -c "import os; print(os.environ['VIRTUAL_ENV'])" | ||
- name: Bump version | ||
run: | | ||
poetry version minor | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add pyproject.toml | ||
git commit -m "bump version from workflow" | ||
git push origin HEAD:${{ github.head_ref }} | ||
- name: Build | ||
run: poetry build | ||
- name: Use Pypi test | ||
run: | | ||
poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.test-pypi ${{ secrets.PYPI_TOKEN }} | ||
- name: Publish | ||
run: poetry publish -r test-pypi | ||
|
||
|
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 +1,17 @@ | ||
[tool.poetry] | ||
name = "pydantic-tfl-api" | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
description = "A Pydantic-based wrapper for the TfL Unified API https://api.tfl.gov.uk/. Not associated with or endorsed by TfL." | ||
authors = ["Rob Aleck <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/mnbf9rca/pydantic_tfl_api" | ||
repository = "https://github.com/mnbf9rca/pydantic_tfl_api" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
pydantic = "^2.8.2" | ||
requests = "^2.32.3" | ||
pydantic = ">=2.8.2" | ||
requests = ">=2.32.3" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "^24.4.2" | ||
|