-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (88 loc) · 2.65 KB
/
build_and_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
101
102
103
name: Build binaries and Upload to Release
on:
workflow_run:
workflows: ["Sync Version"]
types:
- completed
workflow_dispatch: {}
defaults:
run:
shell: bash
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact_name: ToolDelta-windows.exe
- os: ubuntu-latest
artifact_name: ToolDelta-linux
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: "Setup Python, Poetry and Dependencaies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
poetry-version: 1.7.1
python-version: 3.12
- name: Install dependencies
run: poetry install
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: |
poetry add pyinstaller
poetry run pyinstaller -F -i logo.ico -n ${{ matrix.artifact_name }} main.py
mv dist/${{ matrix.artifact_name }} .
- name: Build for Linux x86_64
if: matrix.os == 'ubuntu-latest'
run: |
poetry add pyinstaller
poetry run pyinstaller -F -n ${{ matrix.artifact_name }} main.py
mv dist/${{ matrix.artifact_name }} .
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}
build_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install GitPython packaging pytz
- name: Build Changelog
run: |
python .github/release_produce.py
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog.md
release:
needs: [build, build_changelog]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Get Version
run: echo "VERSION=$(<version)" >> $GITHUB_ENV
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
body_path: changelog/changelog.md
files: |
ToolDelta-windows.exe/ToolDelta-windows.exe
ToolDelta-linux/ToolDelta-linux