Skip to content

Commit 41c93f6

Browse files
committed
chore: remove unused build and add build bot
1 parent 458d3f9 commit 41c93f6

File tree

3 files changed

+71
-99
lines changed

3 files changed

+71
-99
lines changed

.github/workflows/build_android_apk.yaml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/build_bot.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build Bot
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
dispatch_slash_command:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout source code
12+
uses: actions/checkout@v3
13+
14+
# get build name from pubspec.yaml
15+
- name: Get build version
16+
working-directory: frontend/appflowy_flutter
17+
id: get_build_name
18+
run: |
19+
echo "fetching version from pubspec.yaml..."
20+
echo "build_name=$(grep 'version: ' pubspec.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
21+
22+
23+
- uses: peter-evans/slash-command-dispatch@v4
24+
with:
25+
token: ${{ secrets.PAT }}
26+
commands: build
27+
static-args: |
28+
ref=refs/pull/${{ github.event.issue.number }}/head
29+
build_name=${{ steps.get_build_name.outputs.build_name }}

.github/workflows/build_command.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build
2+
3+
on:
4+
repository_dispatch:
5+
types: [build-command]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: notify appflowy_builder
12+
run: |
13+
platform=${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}
14+
build_name=${{ github.event.client_payload.slash_command.args.named.build_name }}
15+
branch=${{ github.event.client_payload.slash_command.args.named.ref }}
16+
build_type=""
17+
arch=""
18+
19+
if [ "$platform" = "android" ]; then
20+
build_type="apk"
21+
elif [ "$platform" = "macos" ]; then
22+
arch="universal"
23+
fi
24+
25+
params=$(jq -n \
26+
--arg ref "main" \
27+
--arg repo "LucasXu0/AppFlowy" \
28+
--arg branch "$branch" \
29+
--arg build_name "$build_name" \
30+
--arg build_type "$build_type" \
31+
--arg arch "$arch" \
32+
'{ref: $ref, inputs: {repo: $repo, branch: $branch, build_name: $build_name, build_type: $build_type, arch: $arch}} | del(.inputs | .. | select(. == ""))')
33+
34+
echo "params: $params"
35+
36+
curl -L \
37+
-X POST \
38+
-H "Accept: application/vnd.github+json" \
39+
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
40+
-H "X-GitHub-Api-Version: 2022-11-28" \
41+
https://api.github.com/repos/AppFlowy-IO/AppFlowy-Builder/actions/workflows/$platform.yaml/dispatches \
42+
-d "$params"

0 commit comments

Comments
 (0)