mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 07:29:19 -04:00
## Linked issue Closes #5374 ## Summary Move .github/scripts to tools/ so they are included in static checking and testing. ## Steps to reproduce (before) - Make a formatting/typing error in prepare_release.py and confirm `ninja check` does not report that. - Modify test_validate_version.py to fail tests and confirm it's not caught by ninja check. ## How to test (after) The scripts should now be included in the checks as the tools/ directory is already included by the build system.
77 lines
2.4 KiB
Plaintext
77 lines
2.4 KiB
Plaintext
set windows-shell := ["pwsh", "-NoLogo", "-NoProfileLoadTime", "-Command"]
|
|
|
|
version := `cat .version`
|
|
|
|
# Prepare a release: validate version, check CI, update .version
|
|
[arg("version", long)]
|
|
[arg("skip-ci-check", long)]
|
|
prepare version skip-ci-check="false":
|
|
python3 tools/prepare_release.py "{{ version }}" \
|
|
{{ if skip-ci-check == "true" { "--skip-ci-check" } else { "" } }}
|
|
|
|
# Build all platforms, no signing or publishing
|
|
[arg("ref", long)]
|
|
build ref:
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign=false \
|
|
-f draft-release=false \
|
|
-f publish-testpypi=false \
|
|
-f publish-pypi=false
|
|
|
|
# Build and sign artifacts
|
|
[arg("ref", long)]
|
|
sign ref:
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign=true \
|
|
-f draft-release=false \
|
|
-f publish-testpypi=false \
|
|
-f publish-pypi=false
|
|
|
|
# Full public release: sign, draft, testpypi, pypi
|
|
[arg("ref", long)]
|
|
public ref:
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign=true \
|
|
-f draft-release=true \
|
|
-f publish-testpypi=true \
|
|
-f publish-pypi=true
|
|
|
|
# Publish Python packages to TestPyPI only
|
|
[arg("ref", long)]
|
|
testpypi ref:
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign=false \
|
|
-f draft-release=false \
|
|
-f publish-testpypi=true \
|
|
-f publish-pypi=false
|
|
|
|
# Publish Python packages to TestPyPI and PyPI
|
|
[arg("ref", long)]
|
|
pypi ref:
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign=false \
|
|
-f draft-release=false \
|
|
-f publish-testpypi=true \
|
|
-f publish-pypi=true
|
|
|
|
# Manual release with explicit flags
|
|
[arg("ref", long)]
|
|
[arg("sign", long)]
|
|
[arg("draft-release", long)]
|
|
[arg("publish-testpypi", long)]
|
|
[arg("publish-pypi", long)]
|
|
[arg("skip-ci-check", long)]
|
|
custom ref sign="false" draft-release="false" publish-testpypi="false" publish-pypi="false" skip-ci-check="false":
|
|
gh workflow run release.yml --ref {{ ref }} \
|
|
-f version="{{ version }}" \
|
|
-f sign={{ sign }} \
|
|
-f draft-release={{ draft-release }} \
|
|
-f publish-testpypi={{ publish-testpypi }} \
|
|
-f publish-pypi={{ publish-pypi }} \
|
|
-f skip-ci-check={{ skip-ci-check }}
|