1
0
Fork 0
mirror of https://github.com/ArtemSBulgakov/buildozer-action.git synced 2024-08-16 10:09:52 +02:00

Move examples to top of Readme

This commit is contained in:
Artem Bulgakov 2020-12-24 20:05:24 +03:00
parent f974a33f8b
commit 57b6d0500d

204
README.md
View file

@ -8,7 +8,108 @@ with [Buildozer](https://github.com/kivy/buildozer). This action uses official
Buildozer [Docker image](https://github.com/kivy/buildozer/blob/master/Dockerfile),
but adds some features and patches to use in GitHub Actions.
*You may want to skip a lot of text and go to [workflow example](#full-workflow).*
## Full workflow
Full workflow with uploading binaries as artifact.
```yaml
name: Build
on: [push, pull_request]
jobs:
# Build job. Builds app for Android with Buildozer
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build with Buildozer
uses: ArtemSBulgakov/buildozer-action@v1
id: buildozer
with:
workdir: test_app
buildozer_version: stable
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: package
path: ${{ steps.buildozer.outputs.filename }}
```
<details>
<summary>Full workflow with uploading binaries to branch</summary>
Builds app and uploads to the `data` branch. Also copy
[.ci/move_binary.py](.ci/move_binary.py) script and create `data` branch as
described above.
```yaml
name: Build
on:
push:
branches-ignore:
- data
- gh-pages
tags:
- '**'
pull_request:
branches-ignore:
- data
- gh-pages
jobs:
# Build job. Builds app for Android with Buildozer
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: master
- name: Build with Buildozer
uses: ArtemSBulgakov/buildozer-action@v1
id: buildozer
with:
repository_root: master
workdir: test_app
buildozer_version: stable
- name: Checkout
uses: actions/checkout@v2
with:
path: data
ref: data # Branch name
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Push binary to data branch
run: python master/.ci/move_binary.py "${{ steps.buildozer.outputs.filename }}" master data
```
</details>
## Examples
You can [search GitHub](https://github.com/search?q=buildozer-action+extension%3Ayml+path%3A.github%2Fworkflows&type=Code)
for repositories that use this action.
Some great examples:
- [kivymd/KivyMD](https://github.com/kivymd/KivyMD/blob/master/.github/workflows/build-demos.yml)
- build several demo apps
- push binaries to branch at another repository
- push binaries by the account of bot (GitHub user)
- set numeric version with environment variable
## Inputs
@ -152,107 +253,6 @@ git commit -m "Add Readme"
git push origin data
```
## Full workflow
Full workflow with uploading binaries as artifact.
```yaml
name: Build
on: [push, pull_request]
jobs:
# Build job. Builds app for Android with Buildozer
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build with Buildozer
uses: ArtemSBulgakov/buildozer-action@v1
id: buildozer
with:
workdir: test_app
buildozer_version: stable
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: package
path: ${{ steps.buildozer.outputs.filename }}
```
<details>
<summary>Full workflow with uploading binaries to branch</summary>
Builds app and uploads to the `data` branch. Also copy
[.ci/move_binary.py](.ci/move_binary.py) script and create `data` branch as
described above.
```yaml
name: Build
on:
push:
branches-ignore:
- data
- gh-pages
tags:
- '**'
pull_request:
branches-ignore:
- data
- gh-pages
jobs:
# Build job. Builds app for Android with Buildozer
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: master
- name: Build with Buildozer
uses: ArtemSBulgakov/buildozer-action@v1
id: buildozer
with:
repository_root: master
workdir: test_app
buildozer_version: stable
- name: Checkout
uses: actions/checkout@v2
with:
path: data
ref: data # Branch name
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Push binary to data branch
run: python master/.ci/move_binary.py "${{ steps.buildozer.outputs.filename }}" master data
```
</details>
## Examples
You can [search GitHub](https://github.com/search?q=buildozer-action+extension%3Ayml+path%3A.github%2Fworkflows&type=Code)
for repositories that use this action.
Some great examples:
- [HeaTTheatR/KivyMD](https://github.com/HeaTTheatR/KivyMD/blob/master/.github/workflows/build-demos.yml)
- build several demo apps
- push binaries to `data` branch
## Action versioning
Currently it is recommended to use `v1` tag. This tag updates when new `v1.x.x`