Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
ab78a81d
Commit
ab78a81d
authored
Dec 25, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GitHub actions
parent
18340099
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
build.yml
.github/workflows/build.yml
+11
-6
build.py
build.py
+11
-3
No files found.
.github/workflows/build.yml
View file @
ab78a81d
...
@@ -39,12 +39,17 @@ jobs:
...
@@ -39,12 +39,17 @@ jobs:
$oldAndroidPath = $env:ANDROID_SDK_ROOT
$oldAndroidPath = $env:ANDROID_SDK_ROOT
$sdk_root = "C:\Android"
$sdk_root = "C:\Android"
New-Item -Path $sdk_root -ItemType SymbolicLink -Value $oldAndroidPath
New-Item -Path $sdk_root -ItemType SymbolicLink -Value $oldAndroidPath
$ndk_ver = Select-String -Path "gradle.properties" -Pattern "^magisk.fullNdkVersion=" | % { $_ -replace ".*=" }
echo "ANDROID_SDK_ROOT=$sdk_root" >> $env:GITHUB_ENV
echo "ANDROID_SDK_ROOT=$sdk_root" >> $env:GITHUB_ENV
echo "ANDROID_HOME=$sdk_root" >> $env:GITHUB_ENV
echo "ANDROID_HOME=$sdk_root" >> $env:GITHUB_ENV
echo "MAGISK_NDK_VERSION=$ndk_ver" >> $env:GITHUB_ENV
-
name
:
Set up GitHub env (Unix)
-
name
:
Set up GitHub env (Unix)
if
:
runner.os != 'Windows'
if
:
runner.os != 'Windows'
run
:
echo ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT >> $GITHUB_ENV
run
:
|
ndk_ver=$(sed -n 's/^magisk.fullNdkVersion=//p' gradle.properties)
echo ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT >> $GITHUB_ENV
echo MAGISK_NDK_VERSION=$ndk_ver >> $GITHUB_ENV
-
name
:
Cache Gradle
-
name
:
Cache Gradle
uses
:
actions/cache@v2
uses
:
actions/cache@v2
...
@@ -60,22 +65,22 @@ jobs:
...
@@ -60,22 +65,22 @@ jobs:
uses
:
actions/cache@v2
uses
:
actions/cache@v2
with
:
with
:
path
:
${{ env.ANDROID_SDK_ROOT }}/ndk/magisk
path
:
${{ env.ANDROID_SDK_ROOT }}/ndk/magisk
key
:
${{ runner.os }}-ndk-${{
hashFiles('gradle.properties')
}}
key
:
${{ runner.os }}-ndk-${{
env.MAGISK_NDK_VERSION
}}
-
name
:
Set up NDK
-
name
:
Set up NDK
if
:
steps.ndk-cache.outputs.cache-hit != 'true'
if
:
steps.ndk-cache.outputs.cache-hit != 'true'
run
:
python
3
build.py ndk
run
:
python build.py ndk
-
name
:
Build release
-
name
:
Build release
run
:
python
3
build.py -vr all
run
:
python build.py -vr all
-
name
:
Build debug
-
name
:
Build debug
run
:
python
3
build.py -v all
run
:
python build.py -v all
# Only upload artifacts built on Linux
# Only upload artifacts built on Linux
-
name
:
Upload build artifact
-
name
:
Upload build artifact
if
:
runner.os == 'Linux' && github.event_name != 'pull_request'
if
:
runner.os == 'Linux' && github.event_name != 'pull_request'
uses
:
actions/upload-artifact@v2
uses
:
actions/upload-artifact@v2
with
:
with
:
name
:
${{ github.sha }}
-artifact
name
:
${{ github.sha }}
path
:
out
path
:
out
build.py
View file @
ab78a81d
...
@@ -4,18 +4,26 @@ import os
...
@@ -4,18 +4,26 @@ import os
import
subprocess
import
subprocess
is_windows
=
os
.
name
==
'nt'
is_windows
=
os
.
name
==
'nt'
if
is_windows
:
is_ci
=
'CI'
in
os
.
environ
and
os
.
environ
[
'CI'
]
==
'true'
if
not
is_ci
and
is_windows
:
import
colorama
import
colorama
colorama
.
init
()
colorama
.
init
()
def
error
(
str
):
def
error
(
str
):
print
(
'
\n
'
+
'
\033
[41m'
+
str
+
'
\033
[0m'
+
'
\n
'
)
if
is_ci
:
print
(
f
'
\n
! {str}
\n
'
)
else
:
print
(
f
'
\n\033
[41m{str}
\033
[0m
\n
'
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
def
header
(
str
):
def
header
(
str
):
print
(
'
\n
'
+
'
\033
[44m'
+
str
+
'
\033
[0m'
+
'
\n
'
)
if
is_ci
:
print
(
f
'
\n
{str}
\n
'
)
else
:
print
(
f
'
\n\033
[44m{str}
\033
[0m
\n
'
)
def
vprint
(
str
):
def
vprint
(
str
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment