From 618ce57398c56f5121b27410a15e4fd1804ffc63 Mon Sep 17 00:00:00 2001 From: Mint de Wit Date: Wed, 1 May 2024 09:49:24 +0000 Subject: [PATCH] chore: wip --- .github/workflows/node.yaml | 36 +++++++++++++++++++++++++-- .github/workflows/prerelease-libs.yml | 15 +++++++++++ packages/openapi/package.json | 1 - 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.yaml b/.github/workflows/node.yaml index 14b7ca0df1..0fba492aa7 100644 --- a/.github/workflows/node.yaml +++ b/.github/workflows/node.yaml @@ -618,6 +618,21 @@ jobs: yarn build env: CI: true + - name: Generate OpenAPI client library + if: ${{ steps.do-publish.outputs.tag }} + uses: hatamiarash7/openapi-generator@v0.3.0 + with: + generator: typescript-fetch + openapi-file: ./packages/openapi/api/actions.yaml + output-dir: ./packages/openapi/client/ts + command-args: -p supportsES6=true + - name: Build OpenAPI client library + if: ${{ steps.do-publish.outputs.tag }} + run: | + cd packages/openapi + yarn build:main + env: + CI: true - name: Modify dependencies to use npm packages run: node scripts/prepublish.js - name: Publish to NPM @@ -673,16 +688,33 @@ jobs: env: CI: true - build-stable-api: - name: Build OpenAPI typescript client + release-openapi-lib: + name: Build and release OpenAPI typescript client runs-on: ubuntu-latest continue-on-error: true timeout-minutes: 15 + + # only run for tags + if: contains(github.ref, 'refs/tags/') + steps: - uses: actions/checkout@v4 with: persist-credentials: false + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".node-version" + - name: Prepare Environment # have to run this first to make sure the semver lib is available + run: | + yarn config set cacheFolder /home/runner/release-libs-cache + + cd packages + yarn install + env: + CI: true + - name: Generate code uses: hatamiarash7/openapi-generator@v0.3.0 with: diff --git a/.github/workflows/prerelease-libs.yml b/.github/workflows/prerelease-libs.yml index cee7b42fd6..6d34115b6a 100644 --- a/.github/workflows/prerelease-libs.yml +++ b/.github/workflows/prerelease-libs.yml @@ -131,6 +131,21 @@ jobs: yarn build env: CI: true + - name: Generate OpenAPI client library + if: ${{ steps.do-publish.outputs.tag }} + uses: hatamiarash7/openapi-generator@v0.3.0 + with: + generator: typescript-fetch + openapi-file: ./packages/openapi/api/actions.yaml + output-dir: ./packages/openapi/client/ts + command-args: -p supportsES6=true + - name: Build OpenAPI client library + if: ${{ steps.do-publish.outputs.tag }} + run: | + cd packages/openapi + yarn build:main + env: + CI: true - name: Modify dependencies to use npm packages run: node scripts/prepublish.js - name: Publish to NPM diff --git a/packages/openapi/package.json b/packages/openapi/package.json index 36b467ed95..b9c4217dbe 100644 --- a/packages/openapi/package.json +++ b/packages/openapi/package.json @@ -1,7 +1,6 @@ { "name": "@sofie-automation/openapi", "version": "1.50.1", - "private": true, "license": "MIT", "repository": { "type": "git",