Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Try again

Try again #15

Workflow file for this run

name: on-push
on:
push:
jobs:
build:
runs-on:
- ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Generate Typescript Client
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: typescript-fetch
openapi-file: spec.json
command-args: -p supportsES6=true -p npmName=awx-api-client -p npmVersion=1.0.0
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
- run: corepack enable
- name: Use Yarn
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- name: Build Typescript Client
working-directory: typescript-fetch-client
run: yarn install && yarn build
- name: Determine Version
id: version
run: |
# Get the latest tag
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
echo "Latest tag: $LATEST_TAG"
# Extract version number and increment it
if [[ "$LATEST_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
NEW_PATCH=$((PATCH + 1))
NEW_TAG="v${MAJOR}.${MINOR}.${NEW_PATCH}"
else
NEW_TAG="1.0.0"
fi
echo "New tag: $NEW_TAG"
echo "::set-output name=tag::$NEW_TAG"
- name: Publish Typescript Client
working-directory: typescript-fetch-client
run: npm publish --tag ${{ steps.version.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}