mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-11-27 23:10:24 +08:00
70 lines
2.4 KiB
YAML
70 lines
2.4 KiB
YAML
name: Release Build
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
chmod a+x ./install-dependents.sh
|
|
chmod a+x ./build.sh
|
|
./install-dependents.sh
|
|
./build.sh
|
|
|
|
- name: Add binaries to production files
|
|
run: wget --input-file=lib-urls.txt --directory-prefix=production-code/daemon/lib/
|
|
|
|
- name: Create linux and windows build
|
|
run: |
|
|
cp -r production-code dist_linux
|
|
mv production-code dist_windows
|
|
|
|
- name: Copy startup scripts
|
|
run: |
|
|
cp prod-scripts/linux/* dist_linux/
|
|
cp prod-scripts/windows/* dist_windows/
|
|
|
|
- name: Copy license
|
|
run: |
|
|
cp LICENSE dist_linux/LICENSE
|
|
cp LICENSE dist_windows/LICENSE
|
|
|
|
- name: Copy node runtime to windows build
|
|
run: |
|
|
wget https://nodejs.org/download/release/latest-v20.x/win-x64/node.exe -O dist_windows/daemon/node_app.exe
|
|
cp dist_windows/daemon/node_app.exe dist_windows/web/node_app.exe
|
|
|
|
- name: Create archive
|
|
run: |
|
|
mv dist_linux/ mcsmanager/
|
|
tar czf mcsmanager_linux_release.tar.gz mcsmanager/
|
|
tar --exclude='mcsmanager/daemon' --exclude='mcsmanager/start-daemon.sh' -czf mcsmanager_linux_web_only_release.tar.gz mcsmanager/
|
|
tar --exclude='mcsmanager/web' --exclude='mcsmanager/start-web.sh' -czf mcsmanager_linux_daemon_only_release.tar.gz mcsmanager/
|
|
rm -rf mcsmanager/
|
|
mv dist_windows/ mcsmanager/
|
|
zip -r mcsmanager_windows_release.zip mcsmanager/
|
|
zip -r mcsmanager_windows_web_only_release.zip mcsmanager/ -x "mcsmanager/daemon/*"
|
|
zip -r mcsmanager_windows_daemon_only_release.zip mcsmanager/ -x "mcsmanager/web/*"
|
|
|
|
- name: Upload assets to release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
mcsmanager_windows_release.zip
|
|
mcsmanager_windows_web_only_release.zip
|
|
mcsmanager_windows_daemon_only_release.zip
|
|
mcsmanager_linux_release.tar.gz
|
|
mcsmanager_linux_web_only_release.tar.gz
|
|
mcsmanager_linux_daemon_only_release.tar.gz
|