-
Notifications
You must be signed in to change notification settings - Fork 18
138 lines (137 loc) · 4.54 KB
/
main.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: "Build Tool"
permissions:
contents: write
discussions: write
on:
push:
paths:
- "bin/setting.ini"
pull_request:
workflow_dispatch:
jobs:
build:
needs: [build-win,build-linux]
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Get Version
id: tool_version
run: |
set ver $(cat bin\setting.ini | findstr version).Split()[2]
echo $ver
echo "::set-output name=version::$ver"
- name: Get last commit SHA
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Get last commit message
id: commit_message
run: echo "::set-output name=message::$(git log -1 --pretty=%B ${{ steps.get_sha.outputs.sha }})"
- name: Rename Tool
# Compress-Archive -Path ./* -DestinationPath ../MIO-KITCHEN-linux-aarch64.zip
# move MIO-KITCHEN-linux-aarch64.zip MIO-KITCHEN-${{ steps.tool_version.outputs.version }}-linux-aarch64.zip
run: |
cd MIO-KITCHEN-win
Remove-Item .git -Recurse
ls
Compress-Archive -Path ./* -DestinationPath ../MIO-KITCHEN-win.zip
cd ..
cd MIO-KITCHEN-linux
ls
Compress-Archive -Path ./* -DestinationPath ../MIO-KITCHEN-linux.zip
cd ..
cd MIO-KITCHEN-linux-aarch64
ls
cd ..
move MIO-KITCHEN-win.zip MIO-KITCHEN-${{ steps.tool_version.outputs.version }}-win.zip
move MIO-KITCHEN-linux.zip MIO-KITCHEN-${{ steps.tool_version.outputs.version }}-linux.zip
- name: Upload release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitBodyDuringUpdate: true
removeArtifacts: true
name: "MIO-KITCHEN-${{ steps.tool_version.outputs.version }}"
tag: "CI_BUILD_${{ github.run_number }}"
body: |
Changelog: ${{ steps.commit_message.outputs.message }}
Build times: ${{ github.run_number }}
Version: ${{ steps.tool_version.outputs.version }}
Note:If u cannot run it in linux,you may need do "chmod a+x ./*"
Author: MIO-KITCHEN-TEAM
Minimum support: Ubuntu 20.04 (64bit|aarch64),Windows Vista (32bit)
artifacts: "*.zip"
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8.10
uses: actions/setup-python@v4
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8.10'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x86'
# You can test your matrix by printing the current Python version
- name: Update pip
run: python -m pip install -U --force-reinstall pip
- name: Install Packages
run: pip install -r requirements.txt
- name: Pack tool
run: |
python build.py
ls
- name: Upload Win Build
if: success()
uses: actions/upload-artifact@v3
with:
name: MIO-KITCHEN-win
path: './*'
build-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.10'
# Optional - x64 or x86 architecture, defaults to x64
- name: Install Packages
run: |
python3 -m pip install -U --force-reinstall pip
pip3 install -r requirements.txt
sudo apt update -y && sudo apt install python3-tk -y
- name: Pack Tool
run: |
python3 build.py
ls
- name: Upload Linux Build
if: success()
uses: actions/upload-artifact@v3
with:
name: MIO-KITCHEN-linux
path: './*'
build-linux-aarch64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Pack Tool
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
run: |
ls
rm -rf ./*
echo "" > empty
- name: Upload Linux Build
if: success()
uses: actions/upload-artifact@v3
with:
name: MIO-KITCHEN-linux-aarch64
path: './*'