Skip to content

Commit

Permalink
spec build workflow: dynamically determine latest spec version (#296)
Browse files Browse the repository at this point in the history
* Update spec build workflow

- Use release tag to determine latest spec version

* Update respec.yaml

* Update respec.yaml
  • Loading branch information
ralfhandl authored Dec 17, 2024
1 parent 42ed9a6 commit 0615263
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/respec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
- 'versions/**'
branches:
- main

workflow_dispatch: {}

jobs:
Expand All @@ -23,14 +22,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2 # checkout main branch
- uses: actions/checkout@v4 # checkout main branch
with:
fetch-depth: 0

- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'

- name: Install dependencies
run: npm i
run: npm ci

- uses: actions/checkout@v2 # checkout gh-pages branch
- uses: actions/checkout@v4 # checkout gh-pages branch
with:
token: ${{ secrets.OAS_REPO_TOKEN }}
repository: OAI/OpenAPI-Specification
Expand All @@ -43,20 +46,21 @@ jobs:
# need to create a pull request against a reomte repository here
# to update the gh-pages branch on the OAI repo
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.OAS_REPO_TOKEN }}
branch: update-arazzo-respec-version
base: gh-pages
delete-branch: true
path: deploy
labels: Housekeeping
title: Update ReSpec versions for Arazzo
commit-message: Update ReSpec versions
reviewers: darrelmiller,webron,earth2marsh,webron,lornajane,mikekistler,miqui,handrews,karenetheridge # ralfhandl
title: Arazzo - Update ReSpec-rendered specification versions
commit-message: Update ReSpec-rendered specification versions
signoff: true
body: |
This pull request is automatically triggered by GitHub action `respec`.
The versions/v*.md files of the Arazzo Specification have changed, so the HTML files are automatically being regenerated.
The `versions/*.md` files of the Arazzo Specification have changed, so the HTML files are automatically being regenerated.
3 changes: 1 addition & 2 deletions scripts/md2html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ cd scripts/md2html
# temporarily copy installed version of respec into build directory
cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/

# latest=`git describe --abbrev=0 --tags` -- introduce after release tags created
latest=1.0.0
latest=`git describe --abbrev=0 --tags`
latestCopied=none
lastMinor="-"
for filename in $(ls -1 ../../versions/[123456789].*.md | sort -r) ; do
Expand Down

0 comments on commit 0615263

Please sign in to comment.