-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (61 loc) · 1.94 KB
/
build.yml
File metadata and controls
68 lines (61 loc) · 1.94 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
name: Build and Release
on:
push:
branches:
- main
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
draft: false
prerelease: false
build_and_upload:
name: Build and Upload on ${{ matrix.os }}
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
asset_name: ai-commit-linux
asset_path_suffix: AI-Commit
- os: windows-latest
asset_name: ai-commit-windows.exe
asset_path_suffix: AI-Commit.exe
- os: macos-latest
asset_name: ai-commit-macos
asset_path_suffix: AI-Commit
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build with PyInstaller
run: pyinstaller --name "AI-Commit" --windowed --onefile --icon="assets/icon.ico" main.py
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./dist/${{ matrix.asset_path_suffix }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream