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
92 changes: 43 additions & 49 deletions .github/workflows/respec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,67 @@ name: respec
# author: @frankkilcommins (inspired by work from @MikeRalphson)

#
# This workflow updates the respec 'pretty' rendered versions of the spec
# on the gh-pages branch when the corresponding markdown files change.
# This workflow creates a pull request for publishing HTML spec versions to the spec.openapis.org site.
#

# run this on push to main
# run this on push to main with changes to files in the versions folder
on:
push:
paths:
- 'versions/**'
- "versions/**"
branches:
- main
workflow_dispatch: {}

jobs:
respec:

runs-on: ubuntu-22.04

steps:
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
owner: OAI
repositories: OpenAPI-Specification

- uses: actions/checkout@v4 # checkout main branch
with:
fetch-depth: 0
- name: Generate access token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
owner: OAI
repositories: spec.openapis.org

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

- name: Install dependencies
run: npm ci
- uses: actions/checkout@v5 # checkout main branch of this repo
with:
fetch-depth: 0

- uses: actions/checkout@v4 # checkout gh-pages branch
with:
token: ${{ steps.generate-token.outputs.token }}
repository: OAI/OpenAPI-Specification
ref: gh-pages
path: deploy
- uses: actions/setup-node@v5 # setup Node.js
with:
node-version: "22.x"

- name: run main script
run: scripts/md2html/build.sh
- name: Install dependencies
run: npm ci

# 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@v6
with:
token: ${{ steps.generate-token.outputs.token }}
branch: update-arazzo-respec-version
base: gh-pages
delete-branch: true
path: deploy
labels: Housekeeping
reviewers: darrelmiller,webron,earth2marsh,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`.
- uses: actions/checkout@v5 # checkout main branch of website repo
with:
token: ${{ steps.generate-token.outputs.token }}
repository: OAI/spec.openapis.org
ref: main
path: deploy

The `versions/*.md` files of the Arazzo Specification have changed, so the HTML files are automatically being regenerated.
- name: run main script
run: scripts/md2html/build.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
branch: arazzo-spec-version
base: main
delete-branch: true
path: deploy
labels: Arazzo,Specification
reviewers: earth2marsh,lornajane,mikekistler,miqui,ralfhandl,whitlockjc,handrews,karenetheridge,frankkilcommins
title: Arazzo - update ReSpec-rendered specification versions
commit-message: Update ReSpec-rendered specification versions
signoff: true
body: |
This pull request is automatically generated by GitHub action `respec`.

The `versions/*.md` files of the Arazzo Specification have changed and the corresponding HTML files are regenerated.
42 changes: 21 additions & 21 deletions .github/workflows/schema-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: schema-publish
# author: @ralfhandl, @frankkilcommins

#
# This workflow copies the x.y schemas to the gh-pages branch
# This workflow creates a pull request for publishing schema iterations to the spec.openapis.org site.
#

# run this on push to main
# run this on push to vX.Y-dev branches or manually
on:
push:
branches:
- 'v[0-9].[0-9]-dev'
- "v[0-9].[0-9]-dev"
paths:
- 'src/schemas/validation/*.yaml'
- 'scripts/schema-publish.sh'
- '.github/workflows/schema-publish.yaml'
- "src/schemas/validation/*.yaml"
- "scripts/schema-publish.sh"
- ".github/workflows/schema-publish.yaml"
workflow_dispatch: {}

jobs:
Expand All @@ -29,24 +29,24 @@ jobs:
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
owner: OAI
repositories: OpenAPI-Specification
- uses: actions/checkout@v4 # checkout main branch
repositories: spec.openapis.org

- uses: actions/checkout@v5 # checkout main branch of this repo
with:
fetch-depth: 0

- uses: actions/setup-node@v4 # setup Node.js
- uses: actions/setup-node@v5 # setup Node.js
with:
node-version: 22.x
node-version: "22.x"

- name: Install dependencies
run: npm ci

- uses: actions/checkout@v4 # checkout gh-pages branch
- uses: actions/checkout@v5 # checkout main branch of website repo
with:
token: ${{ steps.generate-token.outputs.token }}
repository: OAI/OpenAPI-Specification
ref: gh-pages
repository: OAI/spec.openapis.org
ref: main
path: deploy

- name: run main script
Expand All @@ -56,15 +56,15 @@ jobs:
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
branch: publish-arazzo-schema-iteration
base: gh-pages
branch: arazzo-${{ github.ref_name }}-schema-iterations
base: main
delete-branch: true
path: deploy
labels: Housekeeping,Schema
reviewers: darrelmiller,webron,earth2marsh,lornajane,mikekistler,miqui,ralfhandl,handrews,karenetheridge
title: Arazzo - Publish Schema Iterations
commit-message: New Arazzo schema iterations
labels: Arazzo,Schema
reviewers: earth2marsh,lornajane,mikekistler,miqui,ralfhandl,whitlockjc,handrews,karenetheridge,frankkilcommins
title: "Arazzo - publish ${{ github.ref_name }} schema iterations"
commit-message: "New Arazzo schema iterations published from ${{ github.ref_name }}"
signoff: true
body: |
This pull request is automatically triggered by GitHub action `schema-publish` in the OAI/Arazzo-Specification repo.
This pull request is automatically generated by GitHub action `schema-publish` in the OAI/Arazzo-Specification repo.
The `src/schemas/validation/*.yaml` files have changed and JSON files are automatically generated.
1 change: 0 additions & 1 deletion scripts/schema-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ publish_schema() {
local jekyllLander=$(find "$deploydir/$base" -maxdepth 1 -name "*.md")

# Move the jekyll lander markdown for this iteration to the deploy destination.
# The lander files only exist in the gh-pages branch.
if [ ! -z "$jekyllLander" ]; then
mv $jekyllLander $target.md
echo " * $newestCommitDate: $schema & jekyll lander $(basename $jekyllLander)"
Expand Down