36:先install好,再进arm64的容器进行build(容器以root用户运行) #4
Workflow file for this run
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
name: "BuildArm64 And Release" | |
on: | |
push: | |
branches: | |
- build-arm64 | |
jobs: | |
buildArm64-and-upload: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/[email protected] | |
- name: "Setup Node.js environment" | |
uses: actions/[email protected] | |
with: | |
node-version: 16 | |
registry-url: https://npm.pkg.github.com/ | |
- name: "Get package info" | |
id: package-info | |
uses: luizfelipelaviola/get-package-info@v1 | |
with: | |
path: ./packages/mitmproxy | |
- name: "Print" | |
run: | | |
whoami; | |
echo "version = ${{ steps.package-info.outputs.version }}"; | |
echo "github.ref_type = ${{ github.ref_type }}"; | |
echo "github.ref = ${{ github.ref }}"; | |
echo "github.ref_name = ${{ github.ref_name }}"; | |
echo "github.workspace = ${{ github.workspace }}"; | |
- name: "npm install -g lerna@6/yarn" | |
run: | | |
echo "======================================================================"; | |
echo "npm install -g lerna@6"; | |
echo "--------------------"; | |
npm install -g lerna@6; | |
echo "======================================================================"; | |
echo "npm install -g yarn"; | |
echo "--------------------"; | |
npm install -g yarn; | |
- name: "lerna -v | npm -v | yarn -v | yarn config list" | |
run: | | |
echo "======================================================================"; | |
echo "lerna -v"; | |
echo "--------------------"; | |
lerna -v; | |
echo "======================================================================"; | |
echo "npm -v"; | |
echo "--------------------"; | |
npm -v; | |
echo "======================================================================"; | |
echo "yarn -v"; | |
echo "--------------------"; | |
yarn -v; | |
echo "======================================================================"; | |
echo "yarn config list"; | |
echo "--------------------"; | |
yarn config list; | |
- name: "lerna bootstrap" | |
run: | | |
echo "======================================================================"; | |
dir || ls -lah; | |
echo "======================================================================"; | |
echo "lerna bootstrap --npm-client=yarn"; | |
echo "--------------------"; | |
lerna bootstrap --npm-client=yarn; | |
- name: "Set up QEMU" | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64 | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v3 | |
- name: "Build on 'arm64v8/ubuntu:20.04' OS" | |
run: | | |
docker run --rm \ | |
-u 0 \ | |
-v ${{ github.workspace }}:/workspace:rw --workdir=/workspace \ | |
--platform linux/arm64 arm64v8/ubuntu:20.04 \ | |
bash -exc 'whoami && \ | |
uname -a && \ | |
chmod -R 777 /workspace && \ | |
whoami && \ | |
ls -lah && \ | |
cd /workspace/packages/gui && \ | |
ls -lah && \ | |
apt-get update && \ | |
apt-get install curl -y && \ | |
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ | |
apt-get install -y nodejs gcc g++ make && \ | |
apt update && \ | |
apt install python3 -y && \ | |
npm config list && \ | |
node -p "process.arch" && \ | |
node -v && \ | |
npm -v && \ | |
npm run electron:build --unsafe-perm=true --allow-root && \ | |
cd dist_electron && \ | |
ls -lah && \ | |
cd ../../../ && \ | |
ls -lah' | |
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb - Ubuntu" | |
uses: actions/[email protected] | |
with: | |
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.deb | |
name: "DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb" | |
if-no-files-found: error | |
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage - Ubuntu" | |
uses: actions/[email protected] | |
with: | |
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage | |
name: "DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.AppImage" | |
if-no-files-found: error |