feat: initial commit #1
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" | |
on: | |
pull_request: | |
push: | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v31 | |
- uses: cachix/cachix-action@v16 | |
with: | |
name: planet-a-ventures | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Install devenv.sh | |
run: nix profile install nixpkgs#devenv | |
- name: make sure there is no diff | |
run: devenv shell generate-model | |
- name: Diff porcelain | |
uses: mmontes11/diff-porcelain@v0.0.1 | |
with: | |
message: Generated spec file is not up to date. Run 'devenv shell generate-model' and commit the changes or devenv shell refresh-model to pull the latest OpenAPI specification, generate and commit. | |
- name: Build the devenv shell and run any pre-commit hooks | |
run: devenv test | |
env: | |
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | |
build: | |
name: Build distribution 📦 | |
runs-on: ubuntu-latest | |
needs: | |
- tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v31 | |
- uses: cachix/cachix-action@v16 | |
with: | |
name: planet-a-ventures | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Install devenv.sh | |
run: nix profile install nixpkgs#devenv | |
- name: Create the package tarball | |
run: devenv shell build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-pypi: | |
name: >- | |
Publish Python 🐍 distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/p/dlt-source-notion | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |