forked from rave-engine/python3-android
-
Notifications
You must be signed in to change notification settings - Fork 17
76 lines (73 loc) · 2.58 KB
/
test.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
name: Testing
on: push
# Release-related code borrowed from
# https://github.com/actions/create-release/issues/14#issuecomment-555379810
jobs:
release:
runs-on: ubuntu-latest
if: contains(github.ref, '-android')
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
build:
runs-on: ubuntu-latest
strategy:
matrix:
env:
- { ARCH: arm, API: 23 }
- { ARCH: arm64, API: 23 }
env:
PYVER: 3.10.0
steps:
- name: Checkout main repo
uses: actions/checkout@v2
- name: Building
run: |
docker run --rm -v $(pwd):/python3-android \
--env ARCH=${{ matrix.env.ARCH }} \
--env ANDROID_API=${{ matrix.env.API }} \
python:$PYVER-slim /python3-android/docker-build.sh
- name: Create package
id: create_package
run: |
sudo apt-get -y update && sudo apt-get -y install libarchive-tools xz-utils
package_filename=python3-android-$PYVER-${{ matrix.env.ARCH }}-${{ matrix.env.API }}.tar.xz
# sudo needed as files created by docker may not be readable by the current user
cd build && sudo bsdtar --xz -cf $package_filename *
echo ::set-output name=package_filename::$package_filename
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
if: contains(github.ref, '-android')
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
if: contains(github.ref, '-android')
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
if: contains(github.ref, '-android')
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: build/${{ steps.create_package.outputs.package_filename }}
asset_name: ${{ steps.create_package.outputs.package_filename }}
asset_content_type: application/x-xz