diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a95e19c..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: 2 - -jobs: - deploy: - docker: - - image: alpine - steps: - - checkout - - run: | - apk add nodejs - apk add npm - apk add openjdk8-jre - npm install @openapitools/openapi-generator-cli -g - - run: openapi-generator-cli batch \*.yml - - run: - name: Authenticate with registry - command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/.npmrc - - run: | - cd javascript - npm install - npm build - - run: - name: Publish package - command: | - cd javascript - npm publish --access=public - -workflows: - version: 2 - test-deploy: - jobs: - - deploy: - filters: - branches: - only: - - master diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3bab580 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ + +on: + push: + branches: + - master + +name: publish + +# Required for OIDC auth against npmjs.org, see https://docs.npmjs.com/trusted-publishers +permissions: + id-token: write + contents: read + +jobs: + publish: + name: Publish @spaceapi/validator-client on NPM registry + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + - name: Setup dependencies + run: | + npm install -g npm@latest + npm install @openapitools/openapi-generator-cli -g + - name: Generate OpenAPI client + run: | + openapi-generator-cli batch \*.yml + cd javascript + npm install + npm run build + - name: Publish package + run: | + cd javascript + npm publish --access=public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b21c57f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ + +on: push + +name: test + +jobs: + test: + name: Build @spaceapi/validator-client + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + - name: Setup dependencies + run: | + npm install -g npm@latest + npm install @openapitools/openapi-generator-cli -g + - name: Generate OpenAPI client + run: | + openapi-generator-cli batch \*.yml + cd javascript + npm install + npm run build +