-
-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (50 loc) · 1.96 KB
/
workflow.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
name: Build, Lint & Publish
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=40 --max-line-length=300 --statistics
- name: Build executable
run: |
pyinstaller --onefile --clean --name "exitlag-auto-signup v3.${{ github.run_number }}.exe" main.py
- name: Upload Executable
uses: actions/upload-artifact@v3
with:
name: Exitlag Auto Signup v3.${{ github.run_number }}
path: ./dist/exitlag-auto-signup v3.${{ github.run_number }}.exe
- name: Create a new tag
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v3.${{ github.run_number }}" -m "Release v3.${{ github.run_number }}"
git push origin "v3.${{ github.run_number }}"
- name: Publish code
id: create_release
uses: softprops/action-gh-release@v2.0.4
with:
files: |
./dist/exitlag-auto-signup v3.${{ github.run_number }}.exe
name: "Release v3.${{ github.run_number }}"
body: "Commit: ${{ github.sha }}\nDownload the `exitlag-auto-signup v3.${{ github.run_number }}.exe` file or the `source code` and you are good to go!"
tag_name: "v3.${{ github.run_number }}"