-
Notifications
You must be signed in to change notification settings - Fork 179
ci: use nix for workflows #1416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
dcb8c43
build(flake): use PYTHON_VERSION
drainpixie 0ca6317
style(flake): format forAllSystems
drainpixie 6207e27
ci(test-lint): initialise nixification
drainpixie 92eb57e
ci: testing hooks
drainpixie 3a05cb4
fix: prefer yaml over shell branches
drainpixie 4a23836
chore: bump setup-uv
drainpixie b4e9a1e
fix: add test group to renderer
drainpixie f7b506b
ci: restore previous hooks
drainpixie e015ffc
chore(test-lint): doesn't benefit from cachix
drainpixie 1d10010
Merge branch 'main' into ci/nix
drainpixie 4b54eee
build: add wheel derivation
drainpixie 09c4e43
build: switch to uv2nix
drainpixie 92bb0ac
chore: add output to gitignore and tidy
drainpixie aeb5193
ci: bump actions/checkout to v5
drainpixie 599beeb
ci: cd-publish action
drainpixie 1c463ee
fix: incorrect workflow syntax
drainpixie 7a0b0b8
fix: incorrect workflow syntax for lint
drainpixie 0fe2242
build: pure devshell
drainpixie 734d6e7
fix: devShell name, hooks packages, enabled groups
drainpixie 2487ef4
ci: readd cachix for lint
drainpixie 4d0472a
ci: get rid of push filter
drainpixie a39f44d
ci: hardcode cachix instance name
drainpixie c12f101
fix: yaml is a bad format
drainpixie a8fd894
ci: incorrect env mapping
drainpixie cb8c088
ci: bump actions/checkout to v5
drainpixie d11d964
ci: cachix name is amperser
drainpixie bf7deaa
ci: make nix build output full error
drainpixie 3cb40b9
fix: set LC_ALL
drainpixie df3926f
revert: fix: set LC_ALL
drainpixie a20340a
style: format flake
drainpixie e770da1
ci: add changelog generation via cliff
drainpixie 4ffa5b4
fix: wrong variable name
drainpixie 09aaada
fix: env not available
drainpixie 2cd6709
fix: wrong action name
drainpixie 302de9d
ci: prefer devshell over cliff action
drainpixie e1ccb48
refactor: move changelog generation to build step
drainpixie 1e34a84
fix: add depth to checkout
drainpixie 28f21f8
ci: remove useless depth from build step
drainpixie 60467eb
ci: run build on dispatch
drainpixie d8bbc96
ci: tidy + add workflow inputs & changelog only unreleased
drainpixie d057f5b
ci: remove changelog commit
drainpixie 1125f26
ci: tagging + version + bump
drainpixie 4bbcd6b
ci: actually install nix in version job
drainpixie c9fcd03
ci: provenance
drainpixie 5429399
ci: add conditionals for testing
drainpixie 9bd6f8d
ci: publish to pypi
drainpixie a5b7e84
ci: provenance should be generated on dispatch
drainpixie 0c4582b
ci: cleanup & remove conditionals
drainpixie bd20928
fix: implement suggestions
drainpixie 5d816e1
ci: also remove token from lint
drainpixie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| name: "CD: Build & Publish" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version" | ||
| required: true | ||
| type: string | ||
| prerelease: | ||
| description: "Mark as prerelease" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| version: | ||
| name: Bump Version & Tag | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: "[INIT] Checkout" | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: "[INIT] Git Config" | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: "[INIT] Install Nix" | ||
| uses: cachix/install-nix-action@v31 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: "[INIT] Setup Cachix" | ||
| uses: cachix/cachix-action@v15 | ||
| with: | ||
| name: amperser | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
|
||
|
|
||
| - name: "[VERSION] Bump & Commit" | ||
| run: | | ||
| nix develop --command uv version ${{ github.event.inputs.version }} | ||
| nix develop --command git-cliff -c cliff.toml \ | ||
| --tag v${{ github.event.inputs.version }} \ | ||
| -o CHANGELOG.md | ||
|
|
||
| git commit -am "chore: prepare release v${{ github.event.inputs.version }}" || echo "no changes to commit" | ||
|
|
||
| - name: "[GIT] Create tag" | ||
| run: | | ||
| git tag v${{ github.event.inputs.version }} | ||
| git push origin HEAD --tags | ||
|
|
||
| build: | ||
| name: Build Artifacts | ||
| runs-on: ubuntu-latest | ||
| needs: [version] | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| attestations: write | ||
| steps: | ||
| - name: "[INIT] Checkout" | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "[INIT] Install Nix" | ||
| uses: cachix/install-nix-action@v31 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
drainpixie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: "[INIT] Setup Cachix" | ||
| uses: cachix/cachix-action@v15 | ||
| with: | ||
| name: amperser | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
|
||
| - name: "[BUILD] Wheel" | ||
| run: | | ||
| mkdir -p dist | ||
| nix build -L .#wheel | ||
| cp result/*.whl dist/ | ||
|
|
||
|
|
||
| - name: "[BUILD] Source dist" | ||
| run: | | ||
| nix build -L .#sdist | ||
| cp result/*.tar.gz dist/ | ||
|
|
||
| - name: "[CHANGELOG] Generate release notes" | ||
| run: | | ||
| nix develop --command git-cliff -c cliff.toml \ | ||
| --unreleased --verbose \ | ||
| -o dist/RELEASE_NOTES.md | ||
|
|
||
| - name: "[VERIFY] Provenance" | ||
| uses: actions/attest-build-provenance@v3 | ||
| with: | ||
| subject-path: 'dist/*' | ||
|
|
||
| - name: "[UPLOAD] Artifacts" | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist-artifacts | ||
| path: dist/ | ||
| if-no-files-found: error | ||
|
|
||
| github-release: | ||
| name: GitHub Release | ||
| runs-on: ubuntu-latest | ||
| needs: [build] | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: "[INIT] Checkout" | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "[DOWNLOAD] Artifacts" | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist-artifacts | ||
| path: dist/ | ||
|
|
||
| - name: "[INPUT] Get input" | ||
| id: input | ||
| run: | | ||
| echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
| echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: "[RELEASE] Create GitHub release" | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| name: Release ${{ steps.input.outputs.tag }} | ||
| tag_name: ${{ steps.input.outputs.tag }} | ||
| prerelease: ${{ steps.input.outputs.prerelease }} | ||
| body_path: dist/RELEASE_NOTES.md | ||
| files: dist/* | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
drainpixie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| pypi-publish: | ||
| name: Publish to PyPI | ||
| runs-on: ubuntu-latest | ||
| needs: [build] | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: "[INIT] Checkout" | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: "[DOWNLOAD] Artifacts" | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist-artifacts | ||
| path: dist/ | ||
|
|
||
| - name: "[INIT] Install Nix" | ||
| uses: cachix/install-nix-action@v31 | ||
| with: | ||
| nix_path: nixpkgs=channel:nixos-unstable | ||
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: "[INIT] Setup Cachix" | ||
| uses: cachix/cachix-action@v15 | ||
| with: | ||
| name: amperser | ||
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
|
||
| - name: "[PUBLISH] PyPI via uv" | ||
| run: | | ||
| nix develop --command uv publish | ||
drainpixie marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,36 @@ | ||
| # Nix | ||
| .direnv/ | ||
| .envrc | ||
| .result/ | ||
| .pre-commit-config.yaml | ||
|
|
||
| # Python | ||
| *.egg | ||
| *.egg-info | ||
| *.pyc | ||
| cached_func_calls/* | ||
| profile_output | ||
| site/write/* | ||
| tests/corpus/newyorker/* | ||
| cache/* | ||
| proselint/cache/* | ||
| build/* | ||
| *.egg | ||
| *.pstore | ||
| *.rdb | ||
| __pycache__/ | ||
| build/ | ||
| dist/ | ||
| cache/ | ||
| proselint/cache/ | ||
| cached_func_calls/* | ||
|
|
||
| # Coverage | ||
| .coverage | ||
| coverage.lcov | ||
| proselint/proselint_develop.sublime-project | ||
| proselint/proselint_develop.sublime-workspace | ||
| profile_output | ||
|
|
||
| # Tests | ||
| .hypothesis/ | ||
| tests/corpus/newyorker/* | ||
|
|
||
| # Corpora | ||
| corpora/* | ||
| !corpora/README.md | ||
| dist/ | ||
| *.pstore | ||
| .pre-commit-config.yaml | ||
| .hypothesis | ||
| .direnv/ | ||
| .envrc | ||
|
|
||
| # Editor | ||
| proselint/proselint_develop.sublime-workspace | ||
| .proselint/proselint_develop.sublime-project | ||
| .site/write/* |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.