-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (127 loc) · 4.13 KB
/
release.yml
File metadata and controls
155 lines (127 loc) · 4.13 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
id-token: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build-executables:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: vector-bot-linux
- os: windows-latest
asset_name: vector-bot-windows.exe
- os: macOS-latest
asset_name: vector-bot-macos
steps:
- 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 -e .
pip install pyinstaller
- name: Build executable
run: python build_executable.py
- name: Rename executable (Unix)
if: runner.os != 'Windows'
run: |
mv dist/vector-bot dist/${{ matrix.asset_name }}
- name: Rename executable (Windows)
if: runner.os == 'Windows'
run: |
move dist\vector-bot.exe dist\${{ matrix.asset_name }}
- name: Upload executable to release
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}
create-release:
needs: [build-and-publish, build-executables]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release v${{ steps.version.outputs.VERSION }}
body: |
## Vector Bot v${{ steps.version.outputs.VERSION }}
### Installation
**Python Package:**
```bash
pip install vector-bot==${{ steps.version.outputs.VERSION }}
```
**Pre-built Executables:**
- Linux: Download `vector-bot-linux`
- Windows: Download `vector-bot-windows.exe`
- macOS: Download `vector-bot-macos`
### Changes
See [CHANGELOG.md](CHANGELOG.md) for detailed changes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/vector-bot-linux/vector-bot-linux
asset_name: vector-bot-linux
asset_content_type: application/octet-stream
- name: Upload Windows Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/vector-bot-windows.exe/vector-bot-windows.exe
asset_name: vector-bot-windows.exe
asset_content_type: application/octet-stream
- name: Upload macOS Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/vector-bot-macos/vector-bot-macos
asset_name: vector-bot-macos
asset_content_type: application/octet-stream