From 9ef00e4c55b72f8ce83531de9f757318431b5bcf Mon Sep 17 00:00:00 2001 From: Gerardo Lecaros <10088504+glecaros@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:14:53 -0700 Subject: [PATCH] Adding build pipeline (#31) * Adding ado pipeline * Changing to github action. * Updating action versions. --- .github/workflows/typescript-build.yml | 58 ++++++++++++++++++++++++++ sdk/js/packages/client/package.json | 1 + 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/typescript-build.yml diff --git a/.github/workflows/typescript-build.yml b/.github/workflows/typescript-build.yml new file mode 100644 index 0000000..617a6af --- /dev/null +++ b/.github/workflows/typescript-build.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.11.1' + + - name: Install Dependencies + run: npm ci + working-directory: ./sdk/js/packages/client + + - name: Run Linter + run: npm run lint + working-directory: ./sdk/js/packages/client + + - name: Check Format + run: npm run check-format + working-directory: ./sdk/js/packages/client + + - name: Build + run: npm run build + working-directory: ./sdk/js/packages/client + + - name: Test + run: npm test + working-directory: ./sdk/js/packages/client + + - name: Update Version + run: | + version=$(npm pkg get version | tr -d '"') + npm pkg set version="${version}-beta.${GITHUB_RUN_NUMBER}" + working-directory: ./sdk/js/packages/client + + - name: Pack + run: npm pack + working-directory: ./sdk/js/packages/client + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: npm-package + path: ./sdk/js/packages/client/*.tgz \ No newline at end of file diff --git a/sdk/js/packages/client/package.json b/sdk/js/packages/client/package.json index 5aec2be..66b7b7e 100644 --- a/sdk/js/packages/client/package.json +++ b/sdk/js/packages/client/package.json @@ -7,6 +7,7 @@ "build": "rollup -c", "lint": "eslint src", "format": "prettier --write src test", + "check-format": "prettier --check src test", "clean": "rimraf dist", "test": "npm run prepare-tests && vitest --run", "prepare-tests": "playwright install chromium"