From 833b311afe2d6a50e0c8b772541969668979f5bf Mon Sep 17 00:00:00 2001 From: Subhash Chandra Date: Thu, 7 Nov 2024 20:37:25 +0530 Subject: [PATCH] fix: fixed workflow file --- .github/workflows/release.yml | 161 +++++----------------------------- CHANGELOG.md | 3 + example/ios/Podfile.lock | 4 +- ios/hypersdkflutter.podspec | 2 +- 4 files changed, 30 insertions(+), 140 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f385b90..8a1f520 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,54 +30,6 @@ jobs: - name: Run flutter pub publish --dry-run run: flutter pub publish --dry-run - # tag-version: - # needs: dry-run - # runs-on: ubuntu-latest - # name: Tag New Version - # steps: - # - name: Checkout Code - # uses: actions/checkout@v3 - # with: - # repository: ${{ github.event.pull_request.head.repo.full_name }} - # ref: ${{ github.event.pull_request.head.ref }} - # fetch-depth: ${{ github.event.pull_request.commits }} - - # - name: Get current version - # id: get_version - # run: | - # # Get the current version from pubspec.yaml - # CURRENT_VERSION=$(grep 'version: ' pubspec.yaml | sed 's/version: //;s/+.*//') - # echo "Current version is: $CURRENT_VERSION" - # # Export CURRENT_VERSION as an output so it can be used in subsequent steps - # echo "current_version=$CURRENT_VERSION" >> $GITHUB_ENV - - # - name: Generate new version - # id: new_version - # run: | - # # Split the current version into major, minor, and patch - # IFS='.' read -r major minor patch <<< "${{ env.current_version }}" - # # Check if the version parts are valid - # if [[ -z "$major" || -z "$minor" || -z "$patch" ]]; then - # echo "Invalid version format: $CURRENT_VERSION" - # exit 1 - # fi - - # # Increment the patch version - # NEW_PATCH=$((patch + 1)) - # NEW_VERSION="$major.$minor.$NEW_PATCH" - # echo "New version will be: $NEW_VERSION" - # echo "new_version=$NEW_VERSION" >> $GITHUB_ENV - - # - name: Tag the new version - # run: | - # git config user.name "github-actions[bot]" - # git config user.email "github-actions[bot]@users.noreply.github.com" - # git tag "v${{ env.new_version }}" - # git push origin "v${{ env.new_version }}" - # env: - # GITHUB_TOKEN: ${{ secrets.PUB_PUBLISH_TOKEN }} - - publish: if: (github.event.pull_request.merged == true && !contains(github.event.pull_request.title, '[skip ci]')) || github.ref == 'refs/heads/main' runs-on: ubuntu-latest @@ -86,8 +38,14 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - # - name: Set up Flutter - # uses: subosito/flutter-action@v2 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.13.0' + + - name: Install dependencies + run: flutter pub get + - name: Determine release type id: determine-release run: | @@ -148,21 +106,21 @@ jobs: - name: Stash changes run: git reset --hard + - name: Update version in pubspec.yaml + run: | + # Update the version in pubspec.yaml + sed -i "s/^version: .*/version: ${{ env.new_version }}/" pubspec.yaml + + # Commit the updated pubspec.yaml file + git add pubspec.yaml + git commit -m "chore: bump version to ${{ env.new_version }}" + shell: bash + - 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: Tag the new version - run: | - git tag "v${{ env.new_version }}" - git push origin "v${{ env.new_version }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Dependencies - run: flutter pub get - - name: Publish to pub.dev uses: k-paxian/dart-package-publisher@v1.5.1 with: @@ -175,80 +133,9 @@ jobs: env: PUB_ENVIRONMENT: github-action - # merged-pr: - # if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, '[skip ci]') - # runs-on: ubuntu-latest - # steps: - - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # repository: ${{ github.event.pull_request.head.repo.full_name }} - # token: ${{ steps.generate_app_token.outputs.token }} - # fetch-depth: ${{ github.event.pull_request.commits }} - - - # - name: Install dependencies - # run: yarn install --frozen-lockfile - - # - 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 }} + - name: Tag the new version + run: | + git tag "v${{ env.new_version }}" + git push origin "v${{ env.new_version }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b09c5b..525fc94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.0.22 +* Added github actions workflow + # 4.0.21 * Bug fix in process with Container API. * Updated IOS SDK Version to 2.2.1.7 diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0fb32e8..30f71d4 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -10,7 +10,7 @@ PODS: - HyperSDK (2.2.1.7): - JuspaySafeBrowser (= 0.1.84) - Salvator (= 1.0.6) - - hypersdkflutter (4.0.20): + - hypersdkflutter (4.0.22): - Flutter - HyperSDK (= 2.2.1.7) - JuspaySafeBrowser (0.1.84) @@ -41,7 +41,7 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 HyperSDK: 761a9a75197097db5fcd96af8f40892109bb0135 - hypersdkflutter: cc08e7ba805eb9f94672a6cf213247ea28ee00cf + hypersdkflutter: 7d7526602b8b8eff585eb59300a3477717da2633 JuspaySafeBrowser: caa2c1a54405f30210ba9d324cf79224e719134d OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c Salvator: 1de69620ac17123ba3491e27a9a8b35bc5b97eaa diff --git a/ios/hypersdkflutter.podspec b/ios/hypersdkflutter.podspec index 3508c38..49f62ec 100644 --- a/ios/hypersdkflutter.podspec +++ b/ios/hypersdkflutter.podspec @@ -23,7 +23,7 @@ puts ("HyperSDK HyperSDK Version Version: #{hyper_sdk_version}") Pod::Spec.new do |s| s.name = 'hypersdkflutter' - s.version = '4.0.21' + s.version = '4.0.22' s.summary = 'Flutter plugin for Juspay SDK' s.description = <<-DESC Flutter plugin for juspay SDK.