remove files #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate SDKs | |
permissions: | |
checks: write | |
contents: write | |
pull-requests: write | |
statuses: write | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
generate: | |
name: Generate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install APIMatic CLI | |
run: npm install -g @apimatic/cli | |
- name: Generate Typescript SDK | |
run: | | |
apimatic auth:login --auth-key=${{ secrets.APIMATIC_AUTH_KEY }} | |
apimatic sdk:generate --destination=sdks/ts --platform TYPESCRIPT --file=openapi.yaml | |
- name: Set publishing coordiates | |
working-directory: ./sdks/ts/openapi_sdk_typescript | |
run: | | |
echo '{ "version": "1.0.${{ github.run_number }}", "name": "@wiremock-inc/apimatic-sdkgen-demo", "repository": "github:wiremock-inc/apimatic-sdkgen-demo" }' > package-patch.json | |
jq -r -s '.[0] * .[1]' package.json package-patch.json > tmp.json | |
mv -f tmp.json package.json | |
- name: Authenticate with private NPM package | |
working-directory: ./sdks/ts/openapi_sdk_typescript | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | |
- name: Install project dependencies | |
working-directory: ./sdks/ts/openapi_sdk_typescript | |
run: npm i | |
- name: Publish to GitHub Packages NPM | |
working-directory: ./sdks/ts/openapi_sdk_typescript | |
run: npm publish --scope=wiremock-inc --registry=https://npm.pkg.github.com | |