mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-13 18:14:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3aae28174e | ||
|
|
01137f65f6 | ||
|
|
7c01d8dd16 |
@@ -1,49 +0,0 @@
|
||||
name: Release @pybricks/ide-docs
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v4.*'
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish_ide_docs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Get version from tag
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
NPM_VERSION=$(echo "$VERSION" | sed 's/\([0-9]\)a\([0-9]\)/\1-alpha.\2/;s/\([0-9]\)b\([0-9]\)/\1-beta.\2/;s/\([0-9]\)rc\([0-9]\)/\1-rc.\2/')
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
|
||||
echo "NPM_TAG=$(echo "$NPM_VERSION" | grep -q '-' && echo 'next' || echo 'latest')" >> $GITHUB_ENV
|
||||
- name: Ubuntu packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install poetry
|
||||
poetry run python -m pip install --upgrade pip
|
||||
poetry run python -m pip install --upgrade setuptools
|
||||
poetry install --only=doc
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm version --no-git-tag-version "$NPM_VERSION"
|
||||
working-directory: npm/ide-docs
|
||||
- run: yarn build
|
||||
working-directory: npm/ide-docs
|
||||
- run: npm publish --tag "$NPM_TAG"
|
||||
working-directory: npm/ide-docs
|
||||
@@ -38,7 +38,6 @@ jobs:
|
||||
with:
|
||||
node-version: '24'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: poetry run python build.py "$NPM_VERSION"
|
||||
working-directory: jedi
|
||||
- run: python jedi/build.py "$NPM_VERSION"
|
||||
- run: npm publish --tag "$NPM_TAG"
|
||||
working-directory: jedi/npm-build
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v4.*'
|
||||
|
||||
name: Create release on GitHub and PyPI
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
name: Create release on GitHub
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Get tag
|
||||
run: echo "GITHUB_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
|
||||
- name: Create release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [[ "${{ contains(env.GITHUB_TAG, 'a') || contains(env.GITHUB_TAG, 'b') || contains(env.GITHUB_TAG, 'c') }}" == "true" ]]; then
|
||||
PRERELEASE_FLAG="--prerelease"
|
||||
else
|
||||
PRERELEASE_FLAG=""
|
||||
fi
|
||||
gh release create "$tag" \
|
||||
--repo="$GITHUB_REPOSITORY" \
|
||||
--title="${tag#v}" \
|
||||
-F CHANGELOG.md \
|
||||
$PRERELEASE_FLAG
|
||||
build_and_publish:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- run: pipx run poetry build
|
||||
- run: pipx run poetry publish
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
|
||||
+1
-1
@@ -27,7 +27,7 @@ poetry run pytest -vv
|
||||
# @pybricks/jedi npm package
|
||||
echo "==> Building @pybricks/jedi"
|
||||
cd "$REPO_ROOT/jedi"
|
||||
poetry run python build.py "$NPM_VERSION"
|
||||
python3 build.py "$NPM_VERSION"
|
||||
|
||||
# @pybricks/ide-docs npm package
|
||||
echo "==> Building @pybricks/ide-docs"
|
||||
|
||||
+6
-7
@@ -1,14 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
# Run with: poetry run python build.py <npm-version>
|
||||
# Builds the @pybricks/jedi npm package into npm-build/.
|
||||
|
||||
import email.parser
|
||||
import importlib.metadata
|
||||
import json
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tomllib
|
||||
import zipfile
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
@@ -55,12 +54,12 @@ subprocess.check_call(["poetry", "build", "--format=wheel"], cwd=ROOT_DIR)
|
||||
for whl in (ROOT_DIR / "dist").glob("pybricks_jedi-*.whl"):
|
||||
shutil.copy(whl, BUILD_DIR)
|
||||
|
||||
# download transitive dependencies using the versions already installed in the venv
|
||||
# (installed by poetry from the lockfile, so versions are pinned correctly)
|
||||
# download transitive dependencies using versions pinned in poetry.lock
|
||||
transitive_packages = ["jedi", "parso", "docstring-parser", "typing-extensions"]
|
||||
transitive = [
|
||||
f"{pkg}=={importlib.metadata.version(pkg)}" for pkg in transitive_packages
|
||||
]
|
||||
with open(ROOT_DIR / "poetry.lock", "rb") as f:
|
||||
lock = tomllib.load(f)
|
||||
lock_versions = {pkg["name"]: pkg["version"] for pkg in lock["package"]}
|
||||
transitive = [f"{pkg}=={lock_versions[pkg]}" for pkg in transitive_packages]
|
||||
subprocess.check_call(
|
||||
[sys.executable, "-m", "pip", "download", "--only-binary=any"] + transitive,
|
||||
cwd=BUILD_DIR,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pybricks"
|
||||
version = "4.0.0b8"
|
||||
version = "4.0.0b9"
|
||||
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
||||
authors = ["The Pybricks Authors <team@pybricks.com>"]
|
||||
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
||||
|
||||
Reference in New Issue
Block a user