-
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (154 loc) · 5.56 KB
/
main.yml
File metadata and controls
178 lines (154 loc) · 5.56 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#
# Note: I originally had separate the Linux and Windows build jobs into
# separate workflow files, but it did not seem like GitHub Actions would run
# both.
#
# About artifacts: "Each artifact behaves as a file share. Uploading to the
# same artifact multiple times in the same workflow can overwrite and append
# already uploaded files"
name: CI
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# _ _
# | |_ ___ ___| |_
# | __/ _ \/ __| __|
# | || __/\__ \ |_
# \__\___||___/\__|
#
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Install Python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Flake8
shell: bash
run: |
python3 -m pip install poetry
python3 -m poetry install
python3 -m poetry run flake8 .
# _ _
# | (_)_ __ _ ___ __
# | | | '_ \| | | \ \/ /
# | | | | | | |_| |> <
# |_|_|_| |_|\__,_/_/\_\
#
build-linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Install Python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Use PyInstaller to build ELF
- name: Build ELF
shell: bash
run: |
python3 -m pip install poetry
python3 -m poetry install
python3 -m poetry run pyinstaller kasatk.spec
mv ./dist/kasatk ./dist/kasatk-linux-amd64
- name: Upload the PyInstaller Build Artifact
uses: actions/upload-artifact@v2.2.2
with:
# The *artifact* name (an archive), not an individual file name
name: build
path: ./dist/kasatk-linux-amd64
if-no-files-found: error
# _ _
# __ _(_)_ __ __| | _____
# \ \ /\ / / | '_ \ / _` |/ _ \ \ /\ / / __|
# \ V V /| | | | | (_| | (_) \ V V /\__ \
# \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ |___/
#
build-windows:
# The type of runner that the job will run on
# https://github.blog/changelog/2021-11-16-github-actions-windows-server-2022-with-visual-studio-2022-is-now-generally-available-on-github-hosted-runners/
runs-on: windows-2022
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Install Python
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.7'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Use PyInstaller to build EXE
- name: Build Exe
shell: pwsh
run: |
python.exe -m pip install poetry
python.exe -m poetry install
python.exe -m poetry run pyinstaller kasatk.spec
# Save the created EXE file as a build artifact that may be downloaded
- name: Upload the PyInstaller Windows Build Artifact
uses: actions/upload-artifact@v2.2.2
with:
# The *artifact* name (an archive), not an individual file name
name: build
path: ./dist/kasatk.exe
if-no-files-found: error
# _
# _ __ _ __ ___ _ __ ___| | ___ __ _ ___ ___
# | '_ \| '__/ _ \_____| '__/ _ \ |/ _ \/ _` / __|/ _ \
# | |_) | | | __/_____| | | __/ | __/ (_| \__ \ __/
# | .__/|_| \___| |_| \___|_|\___|\__,_|___/\___|
# |_|
pre-release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Jobs that must succeed first
needs:
- test
- build-linux
- build-windows
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Generate Release.txt file
run: echo ${{ github.sha }} > Release.txt
# Note: "With v2, when an artifact is specified by the name input, there
# is no longer an extra directory that is created if the path input is
# not provided." I chose not to include the `path` argument to
# download-artifacts; therefore, the artifacts will land in this current
# directory rather than a subdirectory.
- uses: actions/download-artifact@v2
with:
name: build
- name: List
shell: bash
run: |
ls -R .
- name: Pre-Release
uses: softprops/action-gh-release@v1
with:
files: |
Release.txt
kasatk.exe
kasatk-linux-amd64
draft: true
prerelease: true
fail_on_unmatched_files: true