v1.1.11 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Release Schema | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| create-release-schema: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Update schema version | |
| run: | | |
| # Extract version from tag (e.g., v1.1.3 -> 1.1.3) | |
| TAG_NAME="${{ github.event.release.tag_name }}" | |
| VERSION="${TAG_NAME#v}" | |
| # Update the version in all schema files | |
| python scripts/update_schema_version.py --property version --target-version "$VERSION" | |
| - name: Create release-specific schema file | |
| run: | | |
| # Get the tag name from the release event | |
| TAG_NAME="${{ github.event.release.tag_name }}" | |
| # Update API schemas to point to the tagged version | |
| sed -i "s|https://raw.githubusercontent.com/blues/notecard-schema/master/|https://raw.githubusercontent.com/blues/notecard-schema/refs/tags/${TAG_NAME}/|g" notecard.api.json | |
| # Also update the $id field to reference the tagged version | |
| sed -i "s|https://raw.githubusercontent.com/blues/notecard-schema/master/notecard.api.json|https://raw.githubusercontent.com/blues/notecard-schema/refs/tags/${TAG_NAME}/notecard.api.json|g" notecard.api.json | |
| - name: Upload release asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./notecard.api.json | |
| asset_name: notecard.api.json | |
| asset_content_type: application/json |