-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.56 KB
/
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
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
artifact_name: windows
- os: ubuntu-latest
artifact_name: linux
- os: macos-latest
artifact_name: macos
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build binary
run: pyinstaller --onefile gpt_cmd.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: 'dist/gpt_cmd*'
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Rename artifacts
run: |
mkdir -p bin
for os in windows linux macos; do
ext=""
if [ "$os" = "windows" ]; then
ext=".exe"
fi
src="${os}/gpt_cmd${ext}"
dest="bin/gpt_cmd-${os}${ext}"
echo "Moving $src to $dest"
mv "$src" "$dest"
rm -rf "${os}/"
done
- name: Create release
uses: ncipollo/[email protected]
with:
artifacts: 'bin/gpt_cmd*'