build: update version #413
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
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
nix: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v16 | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: nialov | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN_NIALOV }}" | |
- name: Check with nix | |
# This also builds documentation (fractopo-documentation) so docs job | |
# does not have to run every time | |
run: | | |
nix run .#nix-fast-build -- --skip-cached --no-nom | |
poetry: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.platform }} | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v16 | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: nialov | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN_NIALOV }}" | |
- name: Test with poetry on Python ${{ matrix.python-version }} | |
run: | | |
nix run .#poetry-run -- ${{ matrix.python-version }} pytest | |
release: | |
runs-on: ubuntu-latest | |
needs: [nix, poetry] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v16 | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: nialov | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN_NIALOV }}" | |
- name: Build package with poetry | |
run: | | |
nix run .#poetry -- check | |
nix run .#poetry -- build | |
nix run .#poetry -- publish --dry-run | |
- name: Check that version in pyproject.toml is equivalent to tag | |
if: > | |
github.event_name == 'push' | |
&& startsWith(github.ref, 'refs/tags') | |
run: | | |
nix run .#sync-git-tag-with-poetry | |
git diff --exit-code | |
- name: Publish distribution 📦 to PyPI on tagged commit pushes | |
if: > | |
github.event_name == 'push' | |
&& startsWith(github.ref, 'refs/tags') | |
# uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
nix run .#poetry -- publish --username=__token__ --password=${{ secrets.PYPI_PASSWORD }} --no-interaction | |
- name: Create incremental changelog | |
run: | | |
nix run .#cut-release-changelog > RELEASE_CHANGELOG.md | |
- name: Echo RELEASE_CHANGELOG.md | |
run: cat RELEASE_CHANGELOG.md | |
- name: Publish release on GitHub | |
if: > | |
github.event_name == 'push' | |
&& startsWith(github.ref, 'refs/tags') | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: RELEASE_CHANGELOG.md | |
files: | | |
dist/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docs: | |
if: > | |
github.event_name == 'push' | |
&& startsWith(github.ref, 'refs/heads/master') | |
needs: [nix] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v16 | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: nialov | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN_NIALOV }}" | |
- name: Build documentation | |
run: | | |
nix build .#fractopo.passthru.documentation.doc | |
cp -Lr --no-preserve=mode,ownership,timestamps ./result-doc/share/doc/"$(nix eval --raw .#fractopo.name)"/html ./docs | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload folder with static docs | |
path: "docs/" | |
- uses: actions/configure-pages@v5 | |
- id: deployment | |
uses: actions/deploy-pages@v4 | |
docker: | |
runs-on: ubuntu-latest | |
needs: [nix] | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v16 | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: nialov | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN_NIALOV }}" | |
- name: Push to registry on tag | |
if: > | |
github.event_name == 'push' | |
&& startsWith(github.ref, 'refs/tags') | |
env: | |
PUSHER_TOKEN: ${{ secrets.PUSHER_TOKEN }} | |
REGISTRY: ${{ secrets.REGISTRY }} | |
PROJECT: ${{ secrets.PROJECT }} | |
run: | | |
nix run .#push-fractopo-validation-image -- "$REGISTRY" "$PROJECT" "$PUSHER_TOKEN" |