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;