Bump version to 1!0.1.0.dev2 #62
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
name: Run CI | |
on: | |
push: | |
branches: "*" | |
tags: v*!*.*.* | |
permissions: | |
contents: read | |
concurrency: | |
group: ci | |
cancel-in-progress: false | |
env: | |
PYPI_PACKAGE: hexdoc | |
PYTHON_VERSION: '3.11' | |
HEXDOC_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: read | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
release: ${{ env.HEXDOC_RELEASE }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install display server | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: xvfb | |
- name: Install dependencies | |
run: pip install . hatch | |
- name: Export hexdoc resources | |
run: xvfb-run --auto-servernum hexdoc ci export | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-build | |
path: dist | |
test: | |
runs-on: ubuntu-latest | |
env: | |
HEXDOC_RELEASE: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install display server | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: xvfb | |
- name: Run pre-commit hooks | |
env: | |
SKIP: pyright | |
uses: pre-commit/[email protected] | |
- name: Install Nox | |
run: pip install nox | |
- name: Run Nox | |
run: xvfb-run --auto-servernum nox | |
update-tags: | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
if: needs.build.outputs.release == 'true' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Nox | |
run: pip install nox | |
- name: Run Nox | |
run: nox --session tag | |
- name: Push new tags | |
run: git push --tags --force | |
publish-pypi: | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
if: needs.build.outputs.release == 'true' | |
environment: | |
name: pypi | |
url: https://pypi.org/p/${{ env.PYPI_PACKAGE }} | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download package artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-build | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |