Skip to content
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

Fixed schema directive, removed engine allow_undefined & trim_trailing_newline, both should just enforce defaults #9

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
307 changes: 160 additions & 147 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,155 +2,168 @@ name: Package Release

# A manual workflow, triggered from the UI
on:
workflow_dispatch:
branches:
- main
inputs:
py_rust_release:
description: "Rust-backed Python Release"
type: boolean
required: false
default: false
py_rust_version:
description: "Rust-backed Python Version (now 0.0.9)"
default: "0.0.9"
workflow_dispatch:
branches:
- main
inputs:
py_rust_release:
description: "Rust-backed Python Release"
type: boolean
required: false
default: false
py_rust_version:
description: "Rust-backed Python Version (now 0.0.9)"
default: "0.0.9"



jobs:
commit_versions:
name: Bump Pkg Versions
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
new-sha: ${{ steps.sha.outputs.SHA }}
steps:
- name: Checks out repo with a token that allows pushing to main without PR
uses: actions/checkout@v4
with:
token: ${{ secrets.VERSION_BOT_PAT }}
- uses: actions/setup-python@v4
- uses: ./.github/actions/install-pre-commit

- uses: dtolnay/rust-toolchain@nightly
if: ${{ inputs.py_rust_release }} || ${{ inputs.rust_release }}
with:
components: rustfmt, clippy

- name: Update Rust-backed Python version
if: ${{ inputs.py_rust_release }}
run: |
./dev_scripts/pkg.sh ver_py_rust_update ${{ inputs.py_rust_version }}

- name: add and format added files with pre-commit
# Running on staged change only as that's all that's needed, || true as don't want it to fail, just modify
run: |
git add . &&
./dev_scripts/test.sh pre_till_success &&
git add .

- name: Commit the new version to the repo
uses: EndBug/add-and-commit@v9
with:
push: true
message: "chore: bump package versions for release"
author_name: github-actions
author_email: [email protected]

- name: get sha
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "::set-output name=SHA::$sha_new"

- run: echo ${{ steps.sha.outputs.SHA }}

# Rebuild docs each time this is run, note there is currently no versioning in the docs for each of the individually packages, will need to be added when a public package is being properly released
docs:
name: Docs Release
needs: [commit_versions]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.commit_versions.outputs.new-sha }}

- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.12"
cache: true
cache-dependency-path: "docs/pdm.lock"

- name: Install dependencies
run: |
pdm sync -p ./docs

- name: Build docs
run: |
./dev_scripts/docs.sh build

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
keep_history: true
target_branch: docs-site
build_dir: site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

py_rust_build:
needs: [commit_versions]
# Run only if requested:
if: ${{ inputs.py_rust_release }}
uses: ./.github/workflows/py-rust-build.yml
commit_versions:
name: Bump Pkg Versions
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
new-sha: ${{ steps.sha.outputs.SHA }}
steps:
- name: Checks out repo with a token that allows pushing to main without PR
uses: actions/checkout@v4
with:
token: ${{ secrets.VERSION_BOT_PAT }}
- uses: actions/setup-python@v4
- uses: ./.github/actions/install-pre-commit



- uses: dtolnay/rust-toolchain@nightly
if: ${{ inputs.py_rust_release }} || ${{ inputs.rust_release }}
with:
new-sha: ${{ needs.commit_versions.outputs.new-sha }}
components: rustfmt, clippy

py_rust_release:
name: Rust-backed Python Library Release
# Make needs multiline:
needs: [commit_versions, py_rust_build]
# Run only if requested:
- name: Update Rust-backed Python version
if: ${{ inputs.py_rust_release }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.commit_versions.outputs.new-sha }}

- name: get dist artifacts built in py_rust_build job
uses: actions/download-artifact@v3
with:
name: py_rust_build_files
path: py_rust/dist

- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: pip install twine

- name: Make sure release contents seem valid
run: twine check py_rust/dist/*

- name: upload to pypi
run: twine upload py_rust/dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"

- name: Publish the release notes
uses: release-drafter/release-drafter@v5
with:
publish: true
tag: "v${{ inputs.py_rust_version }}"
name: "v${{ inputs.py_rust_version }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
./dev_scripts/pkg.sh ver_py_rust_update ${{ inputs.py_rust_version }}


- name: add and format added files with pre-commit
# Running on staged change only as that's all that's needed, || true as don't want it to fail, just modify
run: |
git add . &&
./dev_scripts/test.sh pre_till_success &&
git add .

- name: Commit the new version to the repo
uses: EndBug/add-and-commit@v9
with:
push: true
message: "chore: bump package versions for release"
author_name: github-actions
author_email: [email protected]

- name: get sha
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "::set-output name=SHA::$sha_new"

- run:
echo ${{ steps.sha.outputs.SHA }}

# Rebuild docs each time this is run, note there is currently no versioning in the docs for each of the individually packages, will need to be added when a public package is being properly released
docs:
name: Docs Release
needs: [commit_versions]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.commit_versions.outputs.new-sha }}

- name: Set up PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.12"
cache: true
cache-dependency-path: 'docs/pdm.lock'

- name: Install dependencies
run: |
pdm sync -p ./docs


- name: Build docs
run: |
./dev_scripts/docs.sh build

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
with:
keep_history: true
target_branch: docs-site
build_dir: site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}




py_rust_build:
needs: [commit_versions]
# Run only if requested:
if: ${{ inputs.py_rust_release }}
uses: ./.github/workflows/py-rust-build.yml
with:
new-sha: ${{ needs.commit_versions.outputs.new-sha }}

py_rust_release:
name: Rust-backed Python Library Release
# Make needs multiline:
needs: [commit_versions, py_rust_build]
# Run only if requested:
if: ${{ inputs.py_rust_release }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.commit_versions.outputs.new-sha }}


- name: get dist artifacts built in py_rust_build job
uses: actions/download-artifact@v3
with:
name: py_rust_build_files
path: py_rust/dist

- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: pip install twine

- name: Make sure release contents seem valid
run: twine check py_rust/dist/*

- name: upload to pypi
run: twine upload py_rust/dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: "${{ secrets.PYPI_TOKEN }}"

- name: Publish the release notes
uses: release-drafter/release-drafter@v5
with:
publish: true
tag: "v${{ inputs.py_rust_version }}"
name: "v${{ inputs.py_rust_version }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"


3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ target
site
docs/js_ref/
docs/rust_ref/
*.yml
*.yaml
*.toml
*.zetch.*

# Specific to zetch, disable for e.g. some test data that needs its formatting:
Expand Down
16 changes: 8 additions & 8 deletions .zetch.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading