Skip to content

Commit

Permalink
chore: test bot
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Feb 2, 2024
1 parent 458d3f9 commit 444e48a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 99 deletions.
99 changes: 0 additions & 99 deletions .github/workflows/build_android_apk.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/build_bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Bot

on:
issue_comment:
types: [created]

jobs:
dispatch_slash_command:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3

# get build name from pubspec.yaml
- name: Get build version
working-directory: frontend/appflowy_flutter
id: get_build_name
run: |
echo "fetching version from pubspec.yaml..."
echo "build_name=$(grep 'version: ' pubspec.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
- uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.PAT }}
commands: build
static-args: |
ref=refs/pull/${{ github.event.issue.number }}/head
build_name=${{ steps.get_build_name.outputs.build_name }}
28 changes: 28 additions & 0 deletions .github/workflows/build_command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build

on:
repository_dispatch:
types: [build-command]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: notify appflowy_builder
run: |
platform = ${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}
build_name = ${{ github.event.client_payload.slash_command.args.named.build_name }}
branch = ${{ github.event.client_payload.slash_command.args.named.ref }}
params = '{"ref":"main","inputs":{"repo":"LucasXu0/AppFlowy","branch":"$branch","build_name":"build_name"}}'
if [ $platform = "android" ]; then
params = '{"ref":"main","inputs":{"repo":"LucasXu0/AppFlowy","branch":"$branch","build_name":"$build_name","build_type":"apk"}}'
fi
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/AppFlowy-IO/AppFlowy-Builder/actions/workflows/$platform.yaml/dispatches \
-d $params

0 comments on commit 444e48a

Please sign in to comment.