|
1 | 1 | name: Build & Publish Installers |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: # every commit |
| 4 | + push: |
5 | 5 | branches: [ main ] |
6 | | - workflow_dispatch: # manual trigger |
| 6 | + workflow_dispatch: |
7 | 7 | release: |
8 | | - types: [created] # re‑run when you draft a release |
| 8 | + types: [created] |
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | build: |
12 | 12 | strategy: |
13 | 13 | matrix: |
14 | | - os: [ubuntu-latest, windows-latest, macos-latest] |
15 | | - py: [ '3.12' ] # adjust if you need multiple versions |
| 14 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 15 | + py: ['3.12'] |
16 | 16 | runs-on: ${{ matrix.os }} |
17 | 17 |
|
18 | 18 | steps: |
19 | | - - name: Checkout source |
20 | | - uses: actions/checkout@v4 |
| 19 | + - name: Checkout source |
| 20 | + uses: actions/checkout@v4 |
21 | 21 |
|
22 | | - - name: Set up Python |
23 | | - uses: actions/setup-python@v5 |
24 | | - with: |
25 | | - python-version: ${{ matrix.py }} |
| 22 | + - name: Set up Python |
| 23 | + uses: actions/setup-python@v5 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.py }} |
26 | 26 |
|
27 | | - - name: Install dependencies |
28 | | - run: | |
29 | | - python -m pip install --upgrade pip |
30 | | - pip install -r requirements.txt |
31 | | - pip install pyinstaller |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install -r requirements.txt |
| 31 | + pip install pyinstaller |
32 | 32 |
|
33 | | - - name: Build executable |
34 | | - run: | |
35 | | - pyinstaller --clean --noconfirm NexumAI.spec |
36 | | - # Output ends up in dist/NexumAI[.exe|.app|] |
| 33 | + - name: Build executable |
| 34 | + run: | |
| 35 | + pyinstaller --clean --noconfirm NexumAI.spec |
| 36 | + # Output is in dist/NexumAI[.exe|.app|] |
37 | 37 |
|
38 | | - - name: Archive artifact |
39 | | - uses: actions/upload-artifact@v4 |
40 | | - with: |
41 | | - name: NexumAI-${{ matrix.os }} |
42 | | - path: | |
43 | | - dist/** |
44 | | - !dist/**/*.log |
| 38 | + - name: Archive artifact |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: NexumAI-${{ matrix.os }} |
| 42 | + path: | |
| 43 | + dist/** |
| 44 | + !dist/**/*.log |
45 | 45 |
|
46 | 46 | release: |
47 | 47 | needs: build |
48 | | - if: github.event_name == 'push' # only auto‑release on pushes (skip manual runs) |
| 48 | + if: github.event_name == 'release' && github.event.action == 'created' |
49 | 49 | runs-on: ubuntu-latest |
| 50 | + |
50 | 51 | steps: |
51 | | - - name: Download all artifacts |
52 | | - uses: actions/download-artifact@v4 |
53 | | - with: |
54 | | - path: installers |
| 52 | + - name: Download all artifacts |
| 53 | + uses: actions/download-artifact@v4 |
| 54 | + with: |
| 55 | + path: installers |
55 | 56 |
|
56 | | - - name: Create GitHub release |
57 | | - uses: softprops/action-gh-release@v2 |
58 | | - with: |
59 | | - tag_name: ${{ github.sha }} |
60 | | - name: Nightly ${{ github.sha }} |
61 | | - body: | |
62 | | - Automated build from commit ${{ github.sha }} |
63 | | - env: |
64 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Create GitHub release |
| 58 | + uses: softprops/action-gh-release@v2 |
| 59 | + with: |
| 60 | + tag_name: ${{ github.event.release.tag_name }} |
| 61 | + name: ${{ github.event.release.name }} |
| 62 | + body: ${{ github.event.release.body }} |
| 63 | + env: |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
65 | 65 |
|
66 | | - - name: Upload installers to release |
67 | | - uses: softprops/action-gh-release@v2 |
68 | | - with: |
69 | | - files: installers/**/* |
70 | | - env: |
71 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + - name: Upload installers to release |
| 67 | + uses: softprops/action-gh-release@v2 |
| 68 | + with: |
| 69 | + files: installers/**/* |
| 70 | + env: |
| 71 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments