Skip to content
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
10 changes: 6 additions & 4 deletions ci/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ publisher versions. Source revision and package/lock hashes are derived from the
checked-out commit; `image/inputs.json` is generated. The source context is a Git
archive without submodule contents. Frozen dependency installation and persistent
BuildKit `gha` cache retain dependency layers; PRs only read the trusted cache.
A PR build and a mainline build validate different commits. Warm-cache speed is
not established until real runs measure it.
A PR build and a mainline build validate different commits. The first mainline run
populates the cache; measure later runs before claiming a warm-cache speedup.

## Activation and retries

Expand All @@ -23,8 +23,10 @@ access and Actions access for `LUMII-AILab/dspace-angular`. Grant the app reposi
write access through the package's **Manage Actions access**, preserving the existing
package/reader. Do not delete/recreate the package or change visibility.
Then set repository variable `CLARIN_RELEASE_PUBLISH_ENABLED=true`. The one-time
switch is separate from the automatic per-merge flow. The current CLI cannot inspect
package permissions (missing `read:packages`); this review/activation remains pending.
switch is separate from the automatic per-merge flow. Activation was completed on
2026-09-21 after owner confirmation and independent private-package/reader checks.
The ordinary CLI token lacks `read:packages`; do not interpret that token's 403 as
a package visibility or deployment-reader failure.
See [GitHub package access](https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility).

Merge/push and workflow execution require their own requested publication scope.
Expand Down
9 changes: 5 additions & 4 deletions ci/release/publish_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ def find_release():

release = find_release()
if release is None:
command('release', 'create', version, '-R', repo, '--draft', '--target', record['source'],
'--title', version, '--notes',
'Exact-image checks passed. Synthetic rehearsal only; scan findings remain report-only.')
release = find_release()
# Use the creation response: listing immediately afterward can be stale.
release = json.loads(command('api', '--method', 'POST', f'repos/{repo}/releases',
'-f', f'tag_name={version}', '-f', f'target_commitish={record["source"]}',
'-f', f'name={version}', '-F', 'draft=true', '-f',
'body=Exact-image checks passed. Synthetic rehearsal only; scan findings remain report-only.'))
assert release and release['tag_name'] == version
assert release['target_commitish'] == record['source'], 'Release target changed'
names = {asset['name'] for asset in release['assets']}
Expand Down
25 changes: 25 additions & 0 deletions ci/release/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,31 @@ def gh(*args):
state['assets']['release.json']=b'changed'
with self.assertRaises(AssertionError): publish_report.publish(record,root)

def test_new_draft_uses_creation_response_when_release_list_is_stale(self):
import publish_report
with tempfile.TemporaryDirectory() as d:
root=Path(d)
(root/'release.json').write_text('{"verified":true}')
record=dict(repository='owner/app',version='sha-'+'a'*40,source='a'*40)
calls=[]
def gh(*args):
calls.append(args)
if args[:2]==('api','--paginate'): return '' # Listing remains stale.
if args[:3]==('api','--method','POST'):
self.assertIn('draft=true',args)
return json.dumps(dict(id=1,tag_name=record['version'],
target_commitish=record['source'],draft=True,assets=[]))
if args[:2]==('release','download'):
(Path(args[-1])/'release.json').write_bytes((root/'release.json').read_bytes())
if args[0]=='api' and '/commits/' in args[1]:
return json.dumps({'sha':record['source']})
return ''
with patch.object(publish_report,'command',side_effect=gh):
publish_report.publish(record,root)
self.assertEqual(sum(c[:2]==('api','--paginate') for c in calls),1)
self.assertTrue(any(c[:2]==('release','upload') for c in calls))
self.assertTrue(any(c[:2]==('release','edit') for c in calls))

def test_workflow_qualifies_before_publishing_without_private_checkout(self):
workflow=(ROOT/'.github/workflows/clarin-release.yml').read_text()
build,publish=workflow.split('\n publish:\n')
Expand Down
Loading