mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
WORKFLOW: Build artifacts and upload to release (#2120)
This commit is contained in:
115
.github/workflows/build-artifacts.yml
vendored
Normal file
115
.github/workflows/build-artifacts.yml
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
name: Build artifacts
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
name: Build Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
- name: Build the production app
|
||||
shell: bash
|
||||
run: npm run build
|
||||
- name: Build the Electron app
|
||||
shell: bash
|
||||
run: npm run electron-win
|
||||
- name: Zip
|
||||
shell: bash
|
||||
run: cd .build; for i in bitburner-*; do 7z a "$i.zip" "$i"; done; cd ../;
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts-win
|
||||
include-hidden-files: true
|
||||
path: .build/*.zip
|
||||
if-no-files-found: error
|
||||
|
||||
build-linux:
|
||||
name: Build Linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
- name: Build the production app
|
||||
run: npm run build
|
||||
- name: Build the Electron app
|
||||
run: npm run electron-linux
|
||||
- name: Zip
|
||||
run: cd .build; for i in bitburner-*; do zip -r "$i.zip" "$i"; done; cd ../;
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts-linux
|
||||
include-hidden-files: true
|
||||
path: .build/*.zip
|
||||
if-no-files-found: error
|
||||
|
||||
build-mac:
|
||||
name: Build macOS
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
- name: Build the production app
|
||||
run: npm run build
|
||||
- name: Build the Electron app
|
||||
run: npm run electron-mac
|
||||
- name: Zip
|
||||
run: cd .build; for i in bitburner-*; do zip -r "$i.zip" "$i"; done; cd ../;
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts-mac
|
||||
include-hidden-files: true
|
||||
path: .build/*.zip
|
||||
if-no-files-found: error
|
||||
|
||||
upload:
|
||||
name: Upload
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-windows, build-linux, build-mac]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: .build
|
||||
pattern: build-artifacts-*
|
||||
merge-multiple: true
|
||||
- name: List files
|
||||
run: ls -la .build
|
||||
- name: Upload to release
|
||||
env:
|
||||
GH_REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
for i in .build/*.zip; do gh release upload "$GH_REF_NAME" "$i" --clobber; done;
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -126,7 +126,9 @@
|
||||
"watch": "webpack --watch --mode production",
|
||||
"watch:dev": "webpack --watch --mode development",
|
||||
"electron": "bash ./tools/package-electron.sh",
|
||||
"electron:packager-all": "electron-packager .package bitburner --platform all --arch x64,armv7l,arm64,mips64el --out .build --overwrite --icon .package/icon.png --app-copyright \"Copyright (C) 2024 Bitburner\"",
|
||||
"electron-win": "bash ./tools/package-electron.sh win",
|
||||
"electron-linux": "bash ./tools/package-electron.sh linux",
|
||||
"electron-mac": "bash ./tools/package-electron.sh mac",
|
||||
"preversion": "npm install && npm run test",
|
||||
"version": "sh ./tools/build-release.sh && git add --all",
|
||||
"postversion": "git push -u origin dev && git push --tags",
|
||||
|
||||
@@ -17,4 +17,13 @@ cp -r electron/* .package
|
||||
|
||||
BUILD_PLATFORM="${1:-"all"}"
|
||||
# And finally build the app.
|
||||
npm run electron:packager-$BUILD_PLATFORM
|
||||
case $BUILD_PLATFORM in
|
||||
"win")
|
||||
electron-packager .package bitburner --platform win32 --arch x64,arm64 --out .build --overwrite --icon .package/icon.ico --app-copyright "Copyright (C) 2024 Bitburner";;
|
||||
"linux")
|
||||
electron-packager .package bitburner --platform linux --arch x64,arm64 --out .build --overwrite --app-copyright "Copyright (C) 2024 Bitburner";;
|
||||
"mac")
|
||||
electron-packager .package bitburner --platform darwin --arch x64,arm64 --out .build --overwrite --icon .package/icon.icns --app-copyright "Copyright (C) 2024 Bitburner";;
|
||||
*)
|
||||
electron-packager .package bitburner --platform win32,linux,darwin --arch x64,arm64 --out .build --overwrite --icon .package/icon --app-copyright "Copyright (C) 2024 Bitburner";;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user