Skip to content

Commit

Permalink
Merge branch 'main' into fields-sorter
Browse files Browse the repository at this point in the history
  • Loading branch information
mstechly authored May 21, 2024
2 parents e7f708a + bd11a15 commit c6b6998
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 20 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
environment:
name: pypi
# url: https://pypi.org/p/qref
url: https://test.pypi.org/p/qref
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: python -m pip install build --user
- name: Setup poetry
uses: abatilo/actions-poetry@v2
- name: Build the package
# run: poetry config pypi-token.pypi ${{ secrets.TWINE_PASSWORD }}
run: poetry config pypi-token.pypi ${{ secrets.TEST_TWINE_PASSWORD }}



- name: Publish the package
run: poetry publish --build
## Uncomment the below after IT trusted publisher pypi request has been submitted
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
- name: Build docs
run: mike deploy $RELEASE_VERSION latest --update-aliases
env:
RELEASE_VERSION: ${GITHUB_REF#refs/*/} # or #{{ github.ref }}

- name: Push docs
run: git push origin gh-pages:gh-pages


4 changes: 2 additions & 2 deletions .github/workflows/quality_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
- name: Run quality checks
run: |
poetry install
pip install pre-commit
pre-commit install
pip install pre-commit
pre-commit install --hook-type commit-msg
pre-commit run -a
- name: Run mypy
run: MYPYPATH=src poetry run mypy --install-types --non-interactive src
Expand Down
31 changes: 13 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
name: Build and release
name: Manual Trigger

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
release-please:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/qref # TODO: test PyPI
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Increment version
uses: googleapis/release-please-action@v4
with:
python-version: 3.9
- name: Install pypa/build
run: python -m pip install build --user
- name: Build binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-type: python
skip-github-releases: false
skip-github-pull-request: true

# bumps z in x.y.z if the commit message is: "fix: blah blah blah" (patch)
# bumps y in x.y.z if the commit message is: "feature: blah blah blah" (minor)
# bumps x in x.y.z if the commit message is "fix! or feature!: blah blah blah" (major)
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ repos:
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []

0 comments on commit c6b6998

Please sign in to comment.