Skip to content

Commit

Permalink
add support for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Jul 1, 2024
1 parent 6d033aa commit bad75e7
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/onPullRequestMerged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ jobs:
content = content.replace(/version:[ ]+([^\n]+)/g, `version: ${newVersion}`);
fs.writeFileSync('./pubspec.yaml', content);
fs.writeFileSync('version.txt', newVersion);
return newVersion;
- name: Update dependencies and lock files
run: |
flutter pub get
- name: Update iOS podspec
run: |
VERSION=$(cat version.txt)
sed -i '' "s/^ s.version.*$/ s.version = '${VERSION}'/" ios/frontegg_flutter.podspec
- name: Commit changes
shell: bash -ex {0}
run: |
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/onReleaseMerged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
CURRENT_VERSION=$(grep -o "version:.*" $PODSPEC_FILE | grep -o ": [^\n].*" | sed "s/: //g")
echo "::set-output name=CURRENT_VERSION::${CURRENT_VERSION}"
- name: Tag Check
id: tag_check
shell: bash -ex {0}
Expand All @@ -61,27 +62,21 @@ jobs:
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: ""

- name: Create Release
id: create_release
if: steps.tag_check.outputs.exists_tag == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set_current_version.outputs.CURRENT_VERSION }}
tag_name: v${{ steps.set_current_version.outputs.CURRENT_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false


- name: Publish to Trunk to Cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push FronteggSwift.podspec
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -91,15 +86,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: 'https://github.com/${{ github.repository }}/releases/tag/v${{ steps.set_current_version.outputs.CURRENT_VERSION }} is released 🎉'
})
# - name: Notify Slack on deployment
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: Production
# SLACK_COLOR: ${{ job.status }}
# SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
# SLACK_MESSAGE: '${{ github.actor }} has deployed @frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} :rocket:'
# SLACK_TITLE: '@frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} has been successfully published'
# SLACK_USERNAME: ${{ github.actor }}
# SLACK_WEBHOOK: ${{ secrets.SLACK_PRODUCTION_TOKEN }}
# MSG_MINIMAL: Commit,actions url
})
16 changes: 16 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish to pub.dev

on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
# with:
# working-directory: path/to/package/within/repository
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [1.0.0] - Release official version of flutter sdk
## [0.0.5] - Release official version of flutter sdk

## [0.0.4] - Connecting iOS and Android FronteggSDKs and native methods usage

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dart pub add frontegg-flutter

```yaml
dependencies:
frontegg-flutter: ^1.0.0
frontegg-flutter: ^0.0.5
```
## Setup iOS Project
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Flutter (1.0.0)
- frontegg_flutter (1.0.0):
- frontegg_flutter (0.0.5):
- Flutter
- FronteggSwift (~> 1.2.15)
- FronteggSwift (1.2.15)
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "0.0.5"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion ios/frontegg_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'frontegg_flutter'
s.version = '1.0.0'
s.version = '0.0.5'
s.summary = 'A new Flutter plugin project.'
s.description = <<-DESC
A new Flutter plugin project.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: frontegg_flutter
description: Flutter package for Frontegg services
version: 1.0.0
version: 0.0.5
homepage: https://github.com/frontegg/frontegg-flutter

environment:
Expand Down

0 comments on commit bad75e7

Please sign in to comment.