This repository was archived by the owner on Nov 16, 2025. It is now read-only.
Update README.md #29
This file contains hidden or 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: Test and release | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| pip install pre-commit | |
| pip install . | |
| - name: Run pre-commit checks | |
| run: | | |
| pre-commit run --all-files | |
| - name: Run tests | |
| run: thirsty examples/test.gpx output.gpx | |
| bump: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Install dependencies | |
| run: | | |
| pip install . | |
| - name: Check if bump is needed | |
| id: bump_check | |
| run: | | |
| if cz bump --dry-run; then | |
| echo "bump_needed=true" >> $GITHUB_ENV | |
| echo "bump_needed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "bump_needed=false" >> $GITHUB_ENV | |
| echo "bump_needed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Bump version and push tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| if: env.bump_needed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| cz bump --yes | |
| git push origin HEAD:main | |
| git push --tags | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: bump | |
| if: needs.bump_check.outputs.bump_needed == 'true' && github.ref_type == 'tag' | |
| steps: | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: CHANGELOG.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |