diff --git a/.github/workflows/respec.yaml b/.github/workflows/respec.yaml index df29720..bae7e1a 100644 --- a/.github/workflows/respec.yaml +++ b/.github/workflows/respec.yaml @@ -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. diff --git a/.github/workflows/schema-publish.yaml b/.github/workflows/schema-publish.yaml index 2fc6dfe..b99a6a0 100644 --- a/.github/workflows/schema-publish.yaml +++ b/.github/workflows/schema-publish.yaml @@ -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: @@ -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 @@ -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. diff --git a/scripts/schema-publish.sh b/scripts/schema-publish.sh index 0725eff..cf5c9ee 100755 --- a/scripts/schema-publish.sh +++ b/scripts/schema-publish.sh @@ -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)"