-
Notifications
You must be signed in to change notification settings - Fork 312
65 lines (54 loc) · 2.88 KB
/
build_apk.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
# Build APKs for Kiwi Browser Next
name: 'Any branch: Build APK'
# Controls when the action will run. Triggers the workflow on pull request events or manual trigger
on:
pull_request:
branches:
- kiwi
workflow_dispatch:
concurrency: build_test_apk
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Building APK (if manually triggered)
if: github.event_name != 'pull_request'
run: curl --http1.0 --no-buffer -s 'http://longbuild.find.kiwi/build_apk.php?build_key=${{ secrets.BUILD_KEY }}&git_user=${{ github.repository_owner }}&git_repository=${{ github.event.repository.name }}&git_runid=${{ github.run_id }}&git_branch=${{ steps.branch-name.outputs.current_branch }}'
# Variables are from: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pullrequestevent
# and https://docs.github.com/en/rest/reference/pulls
- name: Building APK (if pull request)
if: github.event_name == 'pull_request'
run: curl --http1.0 --no-buffer -s 'http://longbuild.find.kiwi/build_apk.php?build_key=${{ secrets.BUILD_KEY }}&git_user=${{ github.event.pull_request.head.repo.owner.login }}&git_repository=${{ github.event.pull_request.head.repo.name }}&git_runid=${{ github.run_id }}&git_branch=${{ github.event.pull_request.head.ref }}'
- name: Downloading APK
if: github.event_name != 'pull_request'
run: wget -q 'https://build.find.kiwi/apks/${{ github.run_id }}/out.apk'
- name: Creating release
if: github.event_name != 'pull_request'
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_id }}
release_name: Test build ${{ github.run_id }} initiated by ${{ github.actor }}
draft: true
prerelease: true
body: |
This is a test build initiated by ${{ github.actor }}.
- name: Uploading test apk (arm64)
if: github.event_name != 'pull_request'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./out.apk
asset_name: ${{ github.repository_owner }}.${{ github.event.repository.name }}.${{ steps.branch-name.outputs.current_branch }}.${{ github.run_id }}-unofficial-arm64.apk
asset_content_type: application/vnd.android.package-archive
- name: Displaying download link
run: echo "Build can be downloaded at https://build.find.kiwi/apks/${{ github.run_id }}/out.apk"