-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (92 loc) · 2.5 KB
/
cd.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
name: CD
on:
workflow_dispatch:
push:
paths:
- '**/*.py'
branches: [ master ]
jobs:
code_quality:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
deploy_pypi:
name: Deploy Pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
build_executable:
name: Build Executable
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt
- name: Build
run: |
chmod +x devscript/create_exe.sh
./devscript/create_exe.sh
shell: bash
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: executables
path: dist/
deploy_executable:
name: Deploy Executable
runs-on: ubuntu-latest
needs: build_executable
steps:
- uses: actions/checkout@v2
- name: Download files
uses: actions/download-artifact@v4
with:
path: dist/
- name: Get version
run: |
chmod +x devscript/get_version.sh
export WALLME_VERSION=$(devscript/get_version.sh)
echo The new version is $WALLME_VERSION
echo "::set-env name=WALLME_VERSION::$WALLME_VERSION"
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Publish
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ env.WALLME_VERSION }}
prerelease: false
title: ${{ env.WALLME_VERSION }}
files: |
./dist/executables/wallme
./dist/executables/wallme.exe