Auto documentation. #19
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: Create pre-release on Github | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: | | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
- name: Set up pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
restore-keys: ${{ runner.os }}-pip- | |
- name: Set up hatch cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.hatchcache | |
key: ${{ runner.os }}-hatchcache-${{ hashFiles('pyproject.toml') }} | |
restore-keys: ${{ runner.os }}-hatchcache- | |
- name: Set up hatch cache (data) | |
uses: actions/cache@v3 | |
with: | |
path: ~/.hatchdata | |
key: ${{ runner.os }}-hatchdata-${{ hashFiles('pyproject.toml') }} | |
restore-keys: ${{ runner.os }}-hatchdata- | |
- name: Install Hatch | |
run: pipx install hatch | |
- name: Run tests | |
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata run test | |
- name: Lint and Type check | |
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata -e lint run all | |
- name: Build dist | |
run: hatch --cache-dir ~/.hatchcache --data-dir ~/.hatchdata build | |
- uses: ncipollo/release-action@v1 | |
with: | |
tag: "development-${{ github.sha }}" | |
artifacts: "dist/*" | |
generateReleaseNotes: true | |
prerelease: true |