58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: Create GitHub release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
check:
|
|
name: Refresh and validate model catalogs
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Refresh API model catalogs from providers
|
|
run: python tools/update_api_model_catalogs.py
|
|
|
|
- name: Validate API model catalogs
|
|
run: python tools/check_api_model_catalogs.py
|
|
|
|
- name: Commit refreshed catalogs to main
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add web/api_model_catalogs.json
|
|
git diff --cached --quiet || git commit -m "chore: refresh API model catalogs for ${GITHUB_REF_NAME}"
|
|
# The tag points at a commit on main; push the catalog refresh there.
|
|
git push origin HEAD:main
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: check
|
|
if: ${{ github.repository_owner == 'goodguy1963' }}
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Create or update release for tag
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
generate_release_notes: true
|
|
make_latest: true
|
|
append_body: false |