-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.5 KB
/
publish-cli.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
name: Publish CLI
on:
workflow_dispatch:
push:
tags:
- client-v*
jobs:
build:
name: Build CLI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Setup Virtual Environment and Install Dependencies (Unix)
if: runner.os != 'Windows'
run: |
python -m venv venv
source venv/bin/activate
cd client
pip install -r requirements.txt
shell: bash
- name: Setup Virtual Environment and Install Dependencies (Windows)
if: runner.os == 'Windows'
run: |
python -m venv venv
.\venv\Scripts\Activate.ps1
cd client
pip install -r requirements.txt
shell: powershell
- name: Build with PyInstaller (Unix)
if: runner.os != 'Windows'
run: |
source venv/bin/activate
pyinstaller --onefile --name devmate client/devmatecli/client.py
shell: bash
- name: Build with PyInstaller (Windows)
if: runner.os == 'Windows'
run: |
.\venv\Scripts\Activate.ps1
pyinstaller --onefile --name devmate client\devmatecli\client.py
shell: powershell
- name: Upload Binary
uses: actions/[email protected]
with:
name: devmatecli-${{ matrix.os }}
path: ./dist/devmate*
release:
needs: build
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
# Need to get the release-cli.js script
- name: Checkout Code
uses: actions/[email protected]
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Rename Ubuntu to Linux
run: |
mv ./artifacts/devmatecli-ubuntu-latest ./artifacts/devmatecli-linux-latest
shell: bash
- name: Archive Artifacts
run: |
tar czvf devmate-cli.tar.gz -C artifacts .
shell: bash
- name: Create Release
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const createReleaseLogic = require('.github/scripts/release-cli.js');
createReleaseLogic({ github, context, core });