Skip to content

feat: crawl tab shows the number of available nodes #122

feat: crawl tab shows the number of available nodes

feat: crawl tab shows the number of available nodes #122

Workflow file for this run

name: Build Prerelease
on:
push:
paths-ignore:
- "README.md"
- "version.txt"
- "script/**"
- "docs/**"
- ".idea/**"
- "frontend/.idea/**"
- ".gitignore"
branches:
- main
pull_request_target:
branches:
- main
jobs:
Build:
permissions: write-all
strategy:
fail-fast: false
matrix:
build:
- os: windows-latest
GOOS: windows
GOARCH: amd64
- os: windows-latest
GOOS: windows
GOARCH: arm64
- os: windows-latest
GOOS: windows
GOARCH: 386
- os: macos-latest
GOOS: darwin
GOARCH: amd64
- os: macos-latest
GOOS: darwin
GOARCH: arm64
- os: ubuntu-latest
GOOS: linux
GOARCH: amd64
runs-on: ${{ matrix.build.os }}
env:
APP_NAME: pandora-box-${{ matrix.build.GOARCH }}
ZIP_FILE: ${{ matrix.build.GOOS }}-${{ matrix.build.GOARCH }}.zip
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- run: go version
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: node -v
- name: get latest geo ip for windows
if: runner.os == 'Windows'
run: |
choco install wget --no-progress
wget -O backend/meta/geoip.metadb https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb
wget -O backend/meta/GeoSite.dat https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
- name: get latest geo ip for others
if: runner.os != 'Windows'
run: |
wget -O backend/meta/geoip.metadb https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb
wget -O backend/meta/GeoSite.dat https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
- name: Install dependencies
run: |
cd frontend && npm install
go install github.com/wailsapp/wails/v2/cmd/wails@latest
# Dependencies: GNU/Linux
- name: Update system and dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
- name: Build Frontend
run: cd frontend && npm run build
# Build
- name: Build for ${{ matrix.build.GOOS }}-${{ matrix.build.GOARCH }}
env:
GOOS: ${{ matrix.build.GOOS }}
GOARCH: ${{ matrix.build.GOARCH }}
run: ~/go/bin/wails build -tags with_gvisor,webkit2_41 -skipbindings -m -s -trimpath -nosyncgomod -o ${{ env.APP_NAME }}.exe
# Compress: macOS
- name: Create a compressed file for macOS
if: runner.os == 'macOS'
run: |
cd ./build/bin
# The compiled product name of macos is always "${{ env.APP_NAME }}.app"
mv Pandora-Box.app pandora-box-${{ matrix.build.GOARCH }}.app
zip -q -r ${{ env.ZIP_FILE }} pandora-box-${{ matrix.build.GOARCH }}.app
# Compress: Windows
- name: Create a compressed file for Windows
if: runner.os == 'Windows'
run: |
cd ./build/bin
Compress-Archive -Path ${{ env.APP_NAME }}.exe -DestinationPath ${{ env.ZIP_FILE }}
# Compress: GNU/Linux
- name: Create a compressed file for GNU/Linux
if: runner.os == 'Linux'
run: |
cd ./build/bin
mv ${{ env.APP_NAME }}.exe ${{ env.APP_NAME }}
zip ${{ env.ZIP_FILE }} ${{ env.APP_NAME }}
- name: Create Prerelease and Upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/bin/${{ env.ZIP_FILE }}
asset_name: ${{ env.ZIP_FILE }}
tag: Prerelease-${{ github.ref_name }}
release_name: Prerelease-${{ github.ref_name }}
overwrite: true
draft: false
prerelease: true
body: |
Synchronize ${{ github.ref_name }} branch code updates, Auto-generated Prerelease from GitHub Actions.