Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed workflow file #42

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 24 additions & 137 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -41,7 +41,7 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
HyperSDK: 761a9a75197097db5fcd96af8f40892109bb0135
hypersdkflutter: cc08e7ba805eb9f94672a6cf213247ea28ee00cf
hypersdkflutter: 7d7526602b8b8eff585eb59300a3477717da2633
JuspaySafeBrowser: caa2c1a54405f30210ba9d324cf79224e719134d
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
Salvator: 1de69620ac17123ba3491e27a9a8b35bc5b97eaa
Expand Down
2 changes: 1 addition & 1 deletion ios/hypersdkflutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading