forked from lycstar/build_dart_android_arm64_sdk
-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (89 loc) · 2.91 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Main
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: 00 16 * * *
watch:
types: [started]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-dart-sdk:
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v4
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
remove-haskell: 'true'
remove-android: 'true'
- name: Checkout
uses: actions/checkout@v2
- name: Echo Free space
run: |
echo "Free space:"
df -h
- name: Set up Python 2.x
uses: actions/setup-python@v2
with:
python-version: '2.x'
- name: Prepare
run: |
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu g++-arm-linux-gnueabihf
sudo apt-get install g++-multilib
sudo apt-get install zip
- name: Get Resource
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:$PWD/depot_tools"
mkdir dart-sdk
cd dart-sdk
fetch dart
cd sdk
git checkout master
ls
sed -i "s#/data/local/tmp#/data/data/com.termux/files/home/tmp#g" runtime/bin/directory_android.cc
sed -n '431,433p' runtime/bin/directory_android.cc
cd ../
echo "target_os = ['android','linux']" >> .gclient
gclient sync
- name: Build SDK
run: |
export PATH="$PATH:$PWD/depot_tools"
cd dart-sdk/sdk
ls tools/bots
./tools/build.py --no-goma -m release --arch=arm64 --os=android create_sdk
./tools/build.py --no-goma -m release --arch=arm --os=android create_sdk
./tools/build.py --no-goma -m release --arch=arm64 create_sdk
./tools/build.py --no-goma -m release --arch=arm create_sdk
- name: Zip SDK
run: |
cd dart-sdk/sdk/out
ls
zip -q -r dart-sdk-android-arm64.zip ReleaseAndroidARM64/dart-sdk
zip -q -r dart-sdk-android-arm.zip ReleaseAndroidARM/dart-sdk
zip -q -r dart-sdk-linux-arm64.zip ReleaseXARM64/dart-sdk
zip -q -r dart-sdk-linux-arm.zip ReleaseXARM/dart-sdk
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Test with environment variables
run: echo $TAG_NAME - $RELEASE_TIME
env:
TAG_NAME: Dart-SDK
RELEASE_TIME: ${{ steps.date.outputs.date }}
- name: Release SDK
uses: ncipollo/release-action@v1
with:
artifacts: "dart-sdk/sdk/out/*.zip"
tag: Dart-SDK-${{ steps.date.outputs.date }}
token: ${{ secrets.RELEASE_TOKEN }}
allowUpdates: true