feat: add tool exposing editable files (#95) #86
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| jobs: | |
| test: | |
| name: Test | |
| uses: ./.github/workflows/test.yaml | |
| secrets: inherit | |
| tag: | |
| name: Tag | |
| timeout-minutes: 2 | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: write | |
| outputs: | |
| new-version: ${{ steps.bump-version.outputs.new_version }} | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Bump version and create tag | |
| id: bump-version | |
| uses: mathieudutour/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| name: Publish package to PyPI | |
| timeout-minutes: 3 | |
| runs-on: ubuntu-latest | |
| needs: tag | |
| if: needs.tag.outputs.new-version != '' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Set up | |
| uses: ./.github/actions/setup | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set version | |
| run: poetry version "${{ needs.tag.outputs.new-version }}" | |
| - name: Publish | |
| run: poetry publish --build | |
| env: | |
| POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
| build-pages: | |
| name: Build GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: tag | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.3 | |
| - name: Set up AsciiDoctor | |
| uses: reitzig/[email protected] | |
| with: | |
| version: 2.0.18 | |
| - name: Generate man page | |
| run: | | |
| curl https://mtth.github.io/d/asciidoctor.css \ | |
| -o docs/asciidoctor.css | |
| mkdir dist | |
| asciidoctor -b html docs/git-draft.adoc \ | |
| -a stylesheet=asciidoctor.css \ | |
| -a manversion=${{ needs.tag.outputs.new-version }} \ | |
| -o dist/index.html | |
| - name: Upload as artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist/ | |
| deploy-pages: | |
| name: Deploy GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build-pages | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| permissions: | |
| id-token: write | |
| pages: write | |
| steps: | |
| - name: Deploy | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |