12 lines
732 B
Python
12 lines
732 B
Python
"""Runner-neutral artifact generation; no publish/upload/git-host API calls."""
|
|||
|
|
import os
|
||
|
|
from pathlib import Path
|
||
|
|
import json
|
||
|
|
from release import ROOT,DEFAULT_REPOSITORY,build_release
|
||
|
|
manifest=json.loads((ROOT/'module.json').read_text())
|
||
|
|
ref=os.environ.get('GITHUB_REF_NAME') or os.environ.get('GITEA_REF_NAME','')
|
||
|
|
if ref.startswith('v') and ref!='v'+manifest['version']:raise SystemExit('tag/manifest version mismatch')
|
||
|
|
repository=os.environ.get('RELEASE_REPOSITORY')
|
||
|
|
if not repository and os.environ.get('GITHUB_SERVER_URL')=='https://github.com' and os.environ.get('GITHUB_REPOSITORY'):repository='https://github.com/'+os.environ['GITHUB_REPOSITORY']
|
||
|
|
repository=repository or DEFAULT_REPOSITORY
|
||
|
|
print(build_release(repository))
|