-
-
Notifications
You must be signed in to change notification settings - Fork 12
129 lines (110 loc) · 4.05 KB
/
release-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
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
name: Release CLI
on: workflow_dispatch
env:
APP_NAME: streamyx
defaults:
run:
working-directory: apps/cli
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest, macos-13, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CONTROL_REPO_TOKEN }}
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: git config --global url."https://${{ secrets.CONTROL_REPO_TOKEN }}@github.com/".insteadOf ssh://[email protected]/
# https://github.com/nodejs/node-gyp/issues/2869
# https://github.com/actions/runner-images/issues/8615#issuecomment-1773563573
- if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
run: python3 -m pip install setuptools --break-system-packages
- run: npm ci
working-directory: ./
- run: |
test -n $(node -p -e "require('./package.json').version") &&
echo APP_VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV || exit 1
- if: matrix.os == 'windows-latest'
run: npm run build:win
- if: matrix.os == 'macos-latest'
run: npm run build:mac:arm
- if: matrix.os == 'macos-13'
run: npm run build:mac
- if: matrix.os == 'ubuntu-latest'
run: npm run build:linux
- run: npm run test
- if: ${{ matrix.os == 'windows-latest' }}
run: powershell Compress-Archive build\win\streamyx.exe streamyx-x64-win.zip
- if: ${{ matrix.os == 'macos-latest' }}
run: zip -9 -j ${{ env.APP_NAME }}-arm64-mac.zip ./build/mac-arm/${{ env.APP_NAME }}
- if: ${{ matrix.os == 'macos-13' }}
run: zip -9 -j ${{ env.APP_NAME }}-x64-mac.zip ./build/mac/${{ env.APP_NAME }}
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: zip -9 -j ${{ env.APP_NAME }}-x64-linux.zip ./build/linux/${{ env.APP_NAME }}
- uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'windows-latest' }}
with:
name: win-x64
path: ./apps/cli/streamyx-x64-win.zip
- uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'macos-latest' }}
with:
name: mac-arm64
path: ./apps/cli/${{ env.APP_NAME }}-arm64-mac.zip
- uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'macos-13' }}
with:
name: mac-x64
path: ./apps/cli/${{ env.APP_NAME }}-x64-mac.zip
- uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: linux-x64
path: ./apps/cli/${{ env.APP_NAME }}-x64-linux.zip
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CONTROL_REPO_TOKEN }}
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: win-x64
- uses: actions/download-artifact@v4
with:
name: mac-arm64
- uses: actions/download-artifact@v4
with:
name: mac-x64
- uses: actions/download-artifact@v4
with:
name: linux-x64
- name: Get package name and version
run: |
test -n $(node -p -e "require('./package.json').version") &&
echo APP_VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV || exit 1
- name: Create release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
artifacts: '${{ env.APP_NAME }}-x64-win.zip,
${{ env.APP_NAME }}-arm64-mac.zip,
${{ env.APP_NAME }}-x64-mac.zip,
${{ env.APP_NAME }}-x64-linux.zip'
tag: cli-v${{ env.APP_VERSION }}
name: CLI v${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
generateReleaseNotes: true