-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9331e6a
commit 8f9dd75
Showing
7 changed files
with
137 additions
and
22 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Check Version | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get version | ||
id: yq | ||
uses: mikefarah/yq@master | ||
|
||
with: | ||
cmd: yq -r '.version' 'pubspec.yaml' | ||
|
||
- name: Print version | ||
run: echo ${{ steps.yq.outputs.result }} | ||
|
||
- name: Get Latest Tag | ||
id: get_tag | ||
run: | | ||
REPO_NAME=${{ github.repository }} | ||
JSON_RESPONSE=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases") | ||
# Extract tag_name using Python | ||
TAG_NAME=$(python -c "import sys, json; print(json.loads(sys.stdin.read())[0]['tag_name'])" <<< "$JSON_RESPONSE") | ||
echo "latest=${TAG_NAME}">> $GITHUB_OUTPUT | ||
# PAT=${{ secrets.GITHUB_TOKEN }} | ||
# REPO_OWNER=${{ github.repository_owner }} | ||
# LATEST_TAG=$(curl -s -H "Authorization: token $PAT" "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases" | jq -r ".tag_name") | ||
# LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases" | jq -r '.[0].tag_name') | ||
# echo "latest=${LATEST_TAG}">> $GITHUB_OUTPUT | ||
- name: Print version | ||
run: echo "provided_version=${{ steps.yq.outputs.result }} and latest_tag=${{ steps.get_tag.outputs.latest }}" | ||
|
||
- name: Check Version | ||
id: check_version | ||
run: | | ||
latest_tag=${{ steps.get_tag.outputs.latest }} | ||
provided_version=${{ steps.yq.outputs.result }} | ||
# Extract numerical version parts from the tags | ||
latest_version=$(echo "$latest_tag" | sed 's/v\?\([0-9.]*\)[-a-zA-Z]*$/\1/') | ||
provided_version=$(echo "$provided_version" | sed 's/v\?\([0-9.]*\)[-a-zA-Z]*$/\1/') | ||
if [[ "$provided_version" == "$latest_version" ]]; then | ||
echo "trigger_next_action=false">> $GITHUB_OUTPUT | ||
exit 1 | ||
elif [[ "$provided_version" < "$latest_version" ]]; then | ||
echo "trigger_next_action=false">> $GITHUB_OUTPUT | ||
exit 1 | ||
else | ||
echo "trigger_next_action=true">> $GITHUB_OUTPUT | ||
fi | ||
- name: Trigger Next Action | ||
run: echo "Trigger Next Action ${{ steps.check_version.outputs.trigger_next_action }}" | ||
env: | ||
TRIGGER_NEXT_ACTION: ${{ steps.check_version.outputs.trigger_next_action }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Trigger Create Tag and Publish Workflow on PR Merge | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
trigger-create-tag-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check if PR is merged into main | ||
id: check_merged | ||
run: | | ||
if [ "${{ github.event.pull_request.merged }}" = "true" ] && [ "${{ github.event.pull_request.base.ref }}" = "main" ]; then | ||
echo "true" | ||
else | ||
echo "false" | ||
fi | ||
- name: Set trigger_create_tag_and_publish output | ||
id: set_output | ||
env: | ||
TRIGGER_CREATE_TAG_AND_PUBLISH: ${{ steps.check_merged.outputs.outputs.result}} | ||
run: echo "set-env:TRIGGER_CREATE_TAG_AND_PUBLISH=${{ steps.check_merged.outputs.outputs.result}}" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"android":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"macos":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"linux":[],"windows":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]}],"web":[{"name":"firebase_core_web","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core_web-2.6.0/","dependencies":[]}]},"dependencyGraph":[{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_crashlytics","dependencies":["firebase_core"]}],"date_created":"2023-07-11 00:30:35.182476","version":"3.10.3"} | ||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"android":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"macos":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]},{"name":"firebase_crashlytics","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_crashlytics-3.3.3/","native_build":true,"dependencies":["firebase_core"]}],"linux":[],"windows":[{"name":"firebase_core","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core-2.14.0/","native_build":true,"dependencies":[]}],"web":[{"name":"firebase_core_web","path":"/Users/kushalmahapatro/.pub-cache/hosted/pub.dev/firebase_core_web-2.6.0/","dependencies":[]}]},"dependencyGraph":[{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_crashlytics","dependencies":["firebase_core"]}],"date_created":"2023-09-04 21:16:07.499517","version":"3.13.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters