bilibili: update to v1.13.0.3194 #297
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build Packages | |
on: | |
release: | |
types: [published] | |
push: | |
tags: | |
- v* | |
branches: [ master, dev] | |
pull_request: | |
branches: [ master ] | |
# # Allows you to run this workflow manually from the Actions tab | |
# workflow_dispatch: | |
jobs: | |
build-src: | |
name: Build Base Packages | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
ARCH: ['x86_64'] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- 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 | |
run: | | |
ls -l | |
tools/setup-bilibili | |
- 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/build/extensions-${{ steps.tag.outputs.tag }}.tar.gz extensions | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: bilibili-${{ matrix.ARCH }}.src | |
path: tmp/src | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: bilibili-${{ matrix.ARCH }}.build | |
path: tmp/build | |
build-linux: | |
name: Build Linux | |
needs: | |
- build-src | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
ARCH: ['x86_64'] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Prepare | |
run: | | |
sudo npm install asar -g | |
npm install | |
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_VERSION: ${{ steps.tag.outputs.tag }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ls -l | |
mkdir -p tmp/build | |
tools/build-prepare.sh | |
asar e app/app.asar app/app | |
npm run pkg-linux | |
rm -rf tmp/build/linux-unpacked | |
# tools/build-appimage.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: bilibili-${{ matrix.ARCH }}.build | |
path: tmp/build | |
build-win: | |
name: Build Windows | |
needs: | |
- build-src | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [16.x] | |
ARCH: ['x86_64'] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Prepare | |
run: | | |
set -x -u -o pipefail | |
source /etc/os-release | |
# Get rid of packages installed from ppa:ondrej/php so that we will be able to install wine32:i386 without conflicts | |
# (see issue https://github.com/actions/virtual-environments/issues/4589) | |
# In detail we: | |
# 1. Remove all packages that ppa:ondrej/php has but plain Ubuntu doesn't, e.g. everything PHP | |
# 2. Revert (remaining) packages that ppa:ondrej/php and plain Ubuntu share, back to the plain Ubuntu version | |
# 3. Assert that no packages from ppa:ondrej/php are left installed | |
dpkg -l | grep '^ii' | grep -F deb.sury.org | awk '{print $2}' | grep '^php' \ | |
| xargs -r -t sudo apt-get remove --yes libpcre2-posix3 libzip4 | |
dpkg -l | grep '^ii' | grep -F deb.sury.org | awk '{print $2}' | sed "s,\$,/${UBUNTU_CODENAME}," \ | |
| xargs -r -t sudo apt-get install --yes --no-install-recommends --allow-downgrades -V | |
! dpkg -l | grep '^ii' | grep -F deb.sury.org | |
sudo apt update | |
sudo apt install -y wine64 | |
sudo dpkg --add-architecture i386 | |
dpkg --print-foreign-architectures | |
sudo apt update | |
sudo apt install libwine | |
echo "install wine32..." | |
sudo apt install wine32 | |
sudo npm install asar -g | |
npm install | |
echo "$UID" | |
- 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_VERSION: ${{ steps.tag.outputs.tag }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ls -l | |
mkdir -p tmp/build | |
tools/build-prepare.sh | |
asar e app/app.asar app/app | |
npm run pkg-win | |
rm -rf tmp/build/win-unpacked | |
# tools/build-appimage.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: bilibili-${{ matrix.ARCH }}.build | |
path: tmp/build | |
build-deepin: | |
name: Build Deepin Package | |
needs: | |
- build-src | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
ARCH: ['x86_64', 'ARM64'] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Prepare | |
run: | | |
sudo apt-get install -y build-essential fakeroot devscripts debhelper # debmake lintian pbuilder | |
- 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 }}' | |
else | |
BILIBILI_VERSION=$(cat conf/bilibili_version) | |
tag="v${BILIBILI_VERSION}-${tag}" | |
fi | |
echo "tag result: $tag - $name" | |
echo "::set-output name=tag::$tag" | |
echo "::set-output name=name::$name" | |
# https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions | |
- name: Build Deb Package | |
run: | | |
export BUILD_VERSION=${{ steps.tag.outputs.tag }} | |
ls -l | |
mkdir -p tmp/build | |
tools/build-prepare.sh | |
echo "${{ matrix.ARCH }}" | |
if [ "${{ matrix.ARCH }}" == "ARM64" ];then | |
export BUILD_ARCH="arm64" | |
export LD_LIBRARY_PATH="/usr/aarch64-linux-gnu/lib" | |
tools/update-electron | |
else | |
export BUILD_ARCH="amd64" | |
fi | |
tools/build-deepin.sh ${{ steps.tag.outputs.tag }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: bilibili-${{ matrix.ARCH }}.build | |
path: tmp/build | |
# build-arch: | |
# name: Build ArchLinux Package | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 30 | |
# strategy: | |
# matrix: | |
# node-version: [16.x] | |
# ARCH: ['x86_64'] | |
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# submodules: 'recursive' | |
# - name: Use Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# cache: 'npm' | |
# - name: Prepare | |
# run: | | |
# cd compiler && npm install | |
# npm install node-gyp nw-gyp npm -g | |
# node-gyp install | |
# cat /etc/passwd | |
# - 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 ArchLinux Package | |
# uses: countstarlight/arch-makepkg-action@master | |
# env: | |
# BUILD_VERSION: ${{ steps.tag.outputs.tag }} | |
# with: | |
# repos: > | |
# archlinuxcn=https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch | |
# before: "tools/build-aur.sh && sudo pacman -S --noconfirm archlinuxcn-keyring" | |
# packages: > | |
# gconf | |
# p7zip | |
# libxkbfile | |
# python2 | |
# openssl | |
# gcc | |
# make | |
# libssh2 | |
# krb5 | |
# wget | |
# scripts: "cd tmp/AUR && makepkg && ls -l && cd ../../" | |
# - name: Fix Permissions | |
# run: | | |
# sudo chmod -R 0777 tmp | |
# mkdir -p tmp/build | |
# mv tmp/AUR/*.pkg.* tmp/build | |
# cd tmp/build | |
# for file in `ls *.pkg.*`;do mv $file `echo $file|sed 's/:/-/g'`;done; | |
# ls -l | |
# - name: Upload artifact | |
# uses: actions/[email protected] | |
# with: | |
# # Artifact name | |
# name: bilibili-${{ matrix.ARCH }}.build | |
# path: tmp/build | |
# build-snap: | |
# name: Build Snap Package | |
# runs-on: ubuntu-18.04 | |
# timeout-minutes: 30 | |
# strategy: | |
# matrix: | |
# node-version: [16.x] | |
# ARCH: ['x86_64'] | |
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# submodules: 'recursive' | |
# - name: Install Snapcraft | |
# uses: samuelmeuli/action-snapcraft@v1 | |
# with: | |
# use_lxd: true | |
# - name: Prepare | |
# run: | | |
# cd compiler && npm install | |
# git --version | |
# git --help | |
# # You can now run Snapcraft shell commands | |
# - name: Build snap | |
# run: sg lxd -c 'snapcraft --use-lxd' | |
# - name: move file | |
# run: | | |
# mkdir -p tmp/build | |
# mv *.snap tmp/build | |
# - name: Upload artifact | |
# uses: actions/[email protected] | |
# with: | |
# # Artifact name | |
# name: bilibili-${{ matrix.ARCH }}.build | |
# path: tmp/build | |
upload: | |
name: Create release and upload artifacts | |
needs: | |
- build-src | |
- build-linux | |
- build-win | |
- build-deepin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Inspect directory after downloading artifacts | |
run: ls -alFR | |
- 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: Create release and upload artifacts | |
if: startsWith(github.ref, 'refs/heads/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
sudo apt install -y fuse | |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage | |
chmod +x pyuploadtool-x86_64.AppImage | |
./pyuploadtool-x86_64.AppImage \ | |
**src/*.tar.gz \ | |
**build/*.tar.gz \ | |
**build/*.AppImage \ | |
**build/*.deb \ | |
**build/*.exe \ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
# note you'll typically need to create a personal access token | |
# with permissions to create releases in the other repo | |
name: ${{ steps.tag.outputs.name }} | |
tag_name: ${{ steps.tag.outputs.tag }} | |
files: | | |
**src/*.tar.gz | |
**build/*.tar.gz | |
**build/*.AppImage | |
**build/*.deb | |
**build/*.exe |