Skip to content

Commit

Permalink
Merge pull request #60 from Headpat-Community/test/try-workflow
Browse files Browse the repository at this point in the history
test workflow
  • Loading branch information
docimin authored Dec 22, 2024
2 parents 0b2baf0 + efe86c1 commit c00f797
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/comment-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ jobs:
- name: 💬 Post initial status comment
id: comment
run: |
if [[ "${{ github.event.comment.body }}" == "build:android" ]]; then
PLATFORM="android"
else
PLATFORM="ios"
fi
echo "::set-output name=comment_id::$(gh api \
-X POST \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/issues/comments" \
-f body='Building app for ${{ github.event.comment.body == 'build:android' && 'android' || 'ios' }}... This can take about 25 minutes.' \
-H 'Accept: application/vnd.github+json' \
'/repos/${{ github.repository }}/issues/comments' \
-f body='Building app for $PLATFORM... This can take about 25 minutes.' \
--jq '.id')"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -76,34 +81,54 @@ jobs:

- name: 👷 Build app
run: |
if [[ "${{ github.event.comment.body }}" == "build:android" ]]; then
PLATFORM="android"
else
PLATFORM="ios"
fi
eas build --local \
--non-interactive \
--output=./app-build \
--platform=${{ github.event.comment.body == 'build:android' && 'android' || 'ios' }} \
--platform=$PLATFORM \
--profile=production
- name: 🚢 Submit
run: |
eas submit -p ${{ github.event.comment.body == 'build:android' && 'android' || 'ios' }} --profile=production --path app-build
if [[ "${{ github.event.comment.body }}" == "build:android" ]]; then
PLATFORM="android"
else
PLATFORM="ios"
fi
eas submit -p $PLATFORM --profile=production --path app-build
- name: 💬 Update comment to success
if: success()
run: |
if [[ "${{ github.event.comment.body }}" == "build:android" ]]; then
PLATFORM="android"
else
PLATFORM="ios"
fi
gh api \
-X PATCH \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/issues/comments/${{ steps.comment.outputs.comment_id }}" \
-f body='Build complete for ${{ github.event.comment.body == "build:android" && "android" || "ios" }}.'
-f body="Build complete for $PLATFORM."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 💬 Update comment to failure
if: failure()
run: |
if [[ "${{ github.event.comment.body }}" == "build:android" ]]; then
PLATFORM="android"
else
PLATFORM="ios"
fi
gh api \
-X PATCH \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/issues/comments/${{ steps.comment.outputs.comment_id }}" \
-f body='Build failed for ${{ github.event.comment.body == "build:android" && "android" || "ios" }}.'
-f body="Build failed for $PLATFORM."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"applinks:headpat.place",
"applinks:api.headpat.place"
],
"buildNumber": "128",
"buildNumber": "129",
"appleTeamId": "S243K37R5M"
},
"android": {
Expand Down Expand Up @@ -75,7 +75,7 @@
}
},
"package": "com.headpat.app",
"versionCode": 128
"versionCode": 129
},
"extra": {
"router": {
Expand Down

0 comments on commit c00f797

Please sign in to comment.