forked from openandroidinstaller-dev/openandroidinstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (95 loc) · 3.28 KB
/
build-release.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
92
93
94
95
96
97
98
99
100
name: Build release
on:
# run once a new tag is pushed
push:
tags:
- '*'
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'ubuntu-latest']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: pip install -r requirements.txt
- run: python scripts/download-tools.py
- run: pip install black ruff pytest pytest-cov pytest-mock pytest-subprocess
- run: black .
- run: ruff openandroidinstaller/ --ignore E501
- run: PYTHONPATH=openandroidinstaller:$(PYTHONPATH) pytest --cov=openandroidinstaller tests/
build:
needs: ci
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: pip install -r requirements.txt
- run: python scripts/download-tools.py
- run: python scripts/build.py
- uses: actions/upload-artifact@v3
with:
name: openandroidinstaller-${{ github.ref_name }}-${{ matrix.os }}
path: dist/
build-windows:
needs: ci
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: pip install -r requirements.txt
- run: python scripts/download-tools.py
- run: python scripts/build.py
- uses: actions/upload-artifact@v3
with:
name: openandroidinstaller-${{ github.ref_name }}-windows-latest
path: dist/
create-release:
needs:
- build
- build-windows
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- uses: montudor/action-zip@v1
with:
args: zip -qq -r openandroidinstaller-${{ github.ref_name }}-macos-latest.zip openandroidinstaller-${{ github.ref_name }}-macos-latest
- uses: montudor/action-zip@v1
with:
args: zip -qq -r openandroidinstaller-${{ github.ref_name }}-ubuntu-20.04.zip openandroidinstaller-${{ github.ref_name }}-ubuntu-20.04
- uses: montudor/action-zip@v1
with:
args: zip -qq -r openandroidinstaller-${{ github.ref_name }}-ubuntu-latest.zip openandroidinstaller-${{ github.ref_name }}-ubuntu-latest
- uses: montudor/action-zip@v1
with:
args: zip -qq -r openandroidinstaller-${{ github.ref_name }}-windows-latest.zip openandroidinstaller-${{ github.ref_name }}-windows-latest
- name: Display structure of downloaded files
run: ls -R
- name: Create release
uses: dciborow/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
title: Release ${{ github.ref_name }}
files: |
openandroidinstaller-${{ github.ref_name }}-macos-latest.zip
openandroidinstaller-${{ github.ref_name }}-ubuntu-20.04.zip
openandroidinstaller-${{ github.ref_name }}-ubuntu-latest.zip
openandroidinstaller-${{ github.ref_name }}-windows-latest.zip