Skip to content
Open
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
38 changes: 30 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
cache: 'npm'
cache-dependency-path: data_models/package-lock.json

Expand All @@ -34,19 +34,27 @@ jobs:
npx tsp compile . --emit=@typespec/json-schema
chmod +x promote.sh
./promote.sh


- name: Generate Workouts OpenAPI spec
run: |
cd data_models
npx tsp compile specs/data_models/PlannedWorkouts.tsp --config specs/data_models/tspconfig.yaml --output-dir ..
mv ../@typespec/openapi3/workouts.yaml ../workouts.yaml
rm -rf ../@typespec

- name: Bundle OpenAPI v5 specification
run: |
redocly bundle v5.yaml -o v5-bundled.yaml

- name: Bundle OpenAPI v6 specification
run: |
redocly bundle v6.yaml -o v6-bundled.yaml

- name: Validate bundled specifications
run: |
redocly lint v5-bundled.yaml
redocly lint v6-bundled.yaml
redocly lint workouts.yaml

- name: Upload bundled specifications
uses: actions/upload-artifact@v4
Expand All @@ -55,6 +63,7 @@ jobs:
path: |
v5-bundled.yaml
v6-bundled.yaml
workouts.yaml
retention-days: 90

- name: Upload schemas
Expand All @@ -65,6 +74,7 @@ jobs:
retention-days: 90

- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
Expand All @@ -74,14 +84,15 @@ jobs:
release_name: Release ${{ github.ref_name }}
body: |
## Changes

This release includes updated OpenAPI specifications and JSON schemas.

### Artifacts
- `v5-bundled.yaml` - Bundled OpenAPI v5 specification
- `v6-bundled.yaml` - Bundled OpenAPI v6 specification
- `v6-bundled.yaml` - Bundled OpenAPI v6 specification
- `workouts.yaml` - Planned Workouts API specification
- `schemas.zip` - All generated JSON schemas

draft: false
prerelease: false

Expand All @@ -96,7 +107,7 @@ jobs:
asset_name: v5-bundled.yaml
asset_content_type: application/yaml

- name: Upload Release Asset - v6 Bundle
- name: Upload Release Asset - v6 Bundle
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
Expand All @@ -105,4 +116,15 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./v6-bundled.yaml
asset_name: v6-bundled.yaml
asset_content_type: application/yaml

- name: Upload Release Asset - Planned Workouts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./workouts.yaml
asset_name: workouts.yaml
asset_content_type: application/yaml
Loading
Loading