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
42 changes: 39 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,52 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Comment thread
simona-anomis marked this conversation as resolved.
with:
ref: main
token: ${{ secrets.ADR_GITHUB_BOT_PAT || secrets.GITHUB_TOKEN }}

- name: Update Codex Plugin Version
env:
TAG_NAME: ${{ inputs.tag_name }}
run: |
VERSION="${TAG_NAME#v}"
echo "Updating .codex-plugin/plugin.json version to $VERSION"

VERSION="$VERSION" python3 -c "
import json
import os

version = os.environ['VERSION']
path = '.codex-plugin/plugin.json'
with open(path, 'r') as f:
data = json.load(f)
data['version'] = version
with open(path, 'w') as f:
json.dump(data, f, indent=2)
f.write('\n')
"

- name: Commit and push updated version
env:
TAG_NAME: ${{ inputs.tag_name }}
run: |
git config user.name "android-devrel-github-bot"
git config user.email "android-devrel-github-bot@users.noreply.github.com"
git add .codex-plugin/plugin.json
git commit -m "Bump plugin version to $TAG_NAME" || echo "No version change to commit"
git push origin main

- name: Create Zip Archive
run: |
git archive --format=zip --output=android-skills.zip HEAD

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.ADR_GITHUB_BOT_PAT || secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ inputs.tag_name }}
run: |
gh release create ${{ inputs.tag_name }} android-skills.zip --title "Release ${{ inputs.tag_name }}" --notes "Manual release of main branch contents."
gh release create "$TAG_NAME" android-skills.zip \
--target main \
--title "Release $TAG_NAME" \
--notes "Release $TAG_NAME of Android Skills."
43 changes: 42 additions & 1 deletion .github/workflows/update-skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Comment thread
simona-anomis marked this conversation as resolved.
with:
ref: main
token: ${{ secrets.ADR_GITHUB_BOT_PAT }}
Expand Down Expand Up @@ -59,6 +59,47 @@ jobs:
rm -rf temp_skills
echo "Successfully copied directories from github-skills branch."

- name: Update Skill Lists in Plugin Files
run: |
python3 -c "
import json
import pathlib

# Discover all skills with SKILL.md
skill_paths = []
for path in pathlib.Path('.').glob('**/SKILL.md'):
if any(p.startswith('.') for p in path.parts[:-1]):
continue
skill_paths.append(f'./{path.parent.as_posix()}')

skill_paths = sorted(list(set(skill_paths)))

# 1. Update .claude-plugin/marketplace.json in-place
claude_file = pathlib.Path('.claude-plugin/marketplace.json')
if not claude_file.exists():
raise FileNotFoundError(f'Required file {claude_file} does not exist. Ensure you are running on the correct branch.')

with open(claude_file, 'r') as f:
data = json.load(f)
if 'plugins' in data and len(data['plugins']) > 0:
data['plugins'][0]['skills'] = skill_paths
with open(claude_file, 'w') as f:
json.dump(data, f, indent=2)
f.write('\n')

# 2. Update .codex-plugin/plugin.json in-place
codex_file = pathlib.Path('.codex-plugin/plugin.json')
if not codex_file.exists():
raise FileNotFoundError(f'Required file {codex_file} does not exist. Ensure you are running on the correct branch.')

with open(codex_file, 'r') as f:
data = json.load(f)
data['skills'] = [{'source': {'path': p}} for p in skill_paths]
with open(codex_file, 'w') as f:
json.dump(data, f, indent=2)
f.write('\n')
"

- name: Commit and push changes
run: |
git config user.name "android-devrel-github-bot"
Expand Down
Loading