diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..071ab14 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - edited + - synchronize + +jobs: + build-on-pr: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: ${{ github.event.pull_request.commits }} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: npm ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dd79e27 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,97 @@ +name: Releases +on: + pull_request: + branches: + - main + types: + - closed + +jobs: + merged-pr: + if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, '[skip ci]') + runs-on: ubuntu-latest + steps: + + - name: Generate GitHub app token + id: generate_app_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.HYPER_SDK_APP_ID }} + private-key: ${{ secrets.HYPER_SDK_APP_PRIVATE_KEY }} + + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ steps.generate_app_token.outputs.token }} + fetch-depth: ${{ github.event.pull_request.commits }} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: npm ci + + - name: Determine release type + id: determine-release + run: | + shopt -s nocasematch + + if [[ "${{ github.event.pull_request.title }}" =~ (\[breaking\]|\[major\]) ]]; then + echo "release_type=major" >> $GITHUB_OUTPUT + elif [[ "${{ github.event.pull_request.title }}" =~ \[minor\] ]]; then + echo "release_type=minor" >> $GITHUB_OUTPUT + else + echo "release_type=patch" >> $GITHUB_OUTPUT + fi + + shopt -u nocasematch + shell: bash + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v5.1.0 + with: + github-token: ${{ steps.generate_app_token.outputs.token }} + release-count: 0 + skip-version-file: "true" + skip-commit: "true" + git-push: "false" + skip-tag: "true" + skip-bump: "true" + output-file: "false" + + - name: Stash changes + run: git reset --hard + + - name: git config + run: | + git config --local user.name 'hyper-sdk-app[bot]' + git config --local user.email '163947841+hyper-sdk-app[bot]@users.noreply.github.com' + + - name: Run standard version + id: standard-version + run: | + npx standard-version --release-as ${{ steps.determine-release.outputs.release_type }} + echo "tag_name=$(git describe --abbrev=0 --tags)" >>$GITHUB_OUTPUT + + - name: Push tags and changelog + run: git push --follow-tags origin main + env: + GH_TOKEN: ${{ steps.generate_app_token.outputs.token }} + + - name: create release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ steps.generate_app_token.outputs.token }} + with: + tag_name: "${{ steps.standard-version.outputs.tag_name }}" + release_name: "${{ steps.standard-version.outputs.tag_name }}" + body: "${{ steps.changelog.outputs.clean_changelog }}" + + - name: Publish package on NPM 📦 + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1553a15 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,66 @@ + + +## [3.0.6](https://github.com/juspay/hyper-sdk-cordova/compare/v3.0.5...v3.0.6) (2023-11-16) + + +### Features + +* openPaymentPage that calls initiate,process together using HyperCheckoutLite openPaymentPage ([30e9d59](https://github.com/juspay/hyper-sdk-cordova/commit/30e9d59c6ba6113438ef406ecc2f27fc8449ea93)) + + + +## [3.0.5](https://github.com/juspay/hyper-sdk-cordova/compare/v3.0.4...v3.0.5) (2023-11-08) + + +### Bug Fixes + +* updated packages to fix vulnerability ([67a18e1](https://github.com/juspay/hyper-sdk-cordova/commit/67a18e1233bf763b65c2038219adbf37aea24ecb)) + + + +## [3.0.4](https://github.com/juspay/hyper-sdk-cordova/compare/v3.0.3...v3.0.4) (2023-08-31) + + +### Bug Fixes + +* use package name from android-packageName attr if id attribute is missing ([66c3a4d](https://github.com/juspay/hyper-sdk-cordova/commit/66c3a4d8305f019916cfa2796df17385f1855a54)) + + + +## [3.0.3](https://github.com/juspay/hyper-sdk-cordova/compare/v3.0.2...v3.0.3) (2023-08-30) + + +### Bug Fixes + +* fixed postinstall script to take packagename from config.xml instead of manifest file ([99a3f8f](https://github.com/juspay/hyper-sdk-cordova/commit/99a3f8f26881deb61dfbdc2f04d9a90098f9855d)) + + + +## [3.0.2](https://github.com/juspay/hyper-sdk-cordova/compare/v3.0.1...v3.0.2) (2023-08-24) + + +### Bug Fixes + +* fixed isInitialized function to give response in separate callback ([8fbe064](https://github.com/juspay/hyper-sdk-cordova/commit/8fbe0649376f9cfbf2a77472f72a9b180c4fea8c)) + + + +## [3.0.1](https://github.com/juspay/hyper-sdk-cordova/compare/v2.1.0...v3.0.1) (2023-06-06) + + +### Bug Fixes + +* **PICAF-21233:** upgrading major version ([b133c97](https://github.com/juspay/hyper-sdk-cordova/commit/b133c97b1706c31e8266d759f29b3430c678ae78)) +* **PICAF-22235:** Integrated good Demo App ([7654924](https://github.com/juspay/hyper-sdk-cordova/commit/7654924b7b2c2e63210744cf13699e202ea98cca)) + + +### Features + +* **PICAF-21233:** upgraded HyperSDK plugin to 2.0.2 ([bc3d8e5](https://github.com/juspay/hyper-sdk-cordova/commit/bc3d8e5f42e1ca24b034c7dd77802fb137660d72)) + + + +# 2.1.0 (2023-03-24) + + +