Skip to content

Commit

Permalink
refactor: 将app.asar构建独立出去
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed May 9, 2024
1 parent c3abe4a commit 681600a
Showing 1 changed file with 82 additions and 8 deletions.
90 changes: 82 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ on:
# workflow_dispatch:

jobs:
build-src:
build-app:
name: Build Base Packages
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
ARCH: ['x64', 'arm64', 'loong64', 'loongarch64']
ARCH: ['x64']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down Expand Up @@ -57,21 +57,25 @@ jobs:
BUILD_ARCH: ${{ matrix.ARCH }}
run: |
ls -l
tools/setup-bilibili
tools/update-bilibili
tools/fix-other.sh
tools/area-unlimit.sh
mv tmp/bili/resources/* app
- name: Compress Resources
run: |
ls -l
mkdir -p tmp/src
mkdir -p tmp/build
tar -zcf tmp/src/bilibili-${{ steps.tag.outputs.tag }}-${{ matrix.ARCH }}.tar.gz bin app electron
tar -zcf tmp/src/bilibili-${{ steps.tag.outputs.tag }}-${{ matrix.ARCH }}.tar.gz bin app # electron
cp tmp/src/bilibili-${{ steps.tag.outputs.tag }}-${{ matrix.ARCH }}.tar.gz tmp/build/bilibili-${{ steps.tag.outputs.tag }}-app.tar.gz
tar -zcf tmp/build/extensions-${{ steps.tag.outputs.tag }}.tar.gz extensions
- name: Upload artifact
uses: actions/[email protected]
with:
# Artifact name
name: bilibili-${{ matrix.ARCH }}.src
name: bilibili-app.src
path: tmp/src
- name: Upload artifact
uses: actions/[email protected]
Expand All @@ -81,7 +85,71 @@ jobs:
path: tmp/build

build-linux:
name: Build Linux
name: Build Linux Packages
needs:
- build-app
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
ARCH: ['x64', 'arm64', 'loong64', 'loongarch64']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bilibili-app.build
path: tmp/src
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2

- name: Prepare
run: |
sudo apt install wget exiftool
sudo npm install asar -g
echo "$UID, $GID"
- name: Generate TAG
id: Tag
run: |
tag='continuous'
name='Continuous Build'
if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
tag='${{ github.ref_name }}'
name='${{ github.ref_name }}'
fi
echo "tag result: $tag - $name"
echo "::set-output name=tag::$tag"
echo "::set-output name=name::$name"
- name: Build
env:
BUILD_ARCH: ${{ matrix.ARCH }}
run: |
ls -l
tools/update-electron
- name: Compress Resources
run: |
ls -l
mkdir -p tmp/src
mkdir -p tmp/build
tar -zcf tmp/build/bilibili-${{ steps.tag.outputs.tag }}-${{ matrix.ARCH }}.tar.gz bin app electron
- name: Upload artifact
uses: actions/[email protected]
with:
# Artifact name
name: bilibili-${{ matrix.ARCH }}.build
path: tmp/build

build-appimage:
name: Build AppImage
needs:
- build-src
runs-on: ubuntu-latest
Expand All @@ -96,6 +164,9 @@ jobs:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bilibili-app.build
path: tmp/src

- name: Prepare
run: |
Expand Down Expand Up @@ -152,6 +223,9 @@ jobs:
- uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bilibili-app.build
path: tmp/src

- name: Prepare
run: |
Expand Down Expand Up @@ -232,7 +306,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bilibili-${{ matrix.ARCH }}.build
name: bilibili-app.build
path: tmp/src

- name: Prepare
Expand Down Expand Up @@ -397,8 +471,8 @@ jobs:
upload:
name: Create release and upload artifacts
needs:
- build-src
- build-linux
- build-appimage
- build-win
- build-deepin
runs-on: ubuntu-latest
Expand Down

0 comments on commit 681600a

Please sign in to comment.