优化 build-and-release.yml: 升级部分uses的版本。

pull/360/head
王良 2 months ago
parent 8d4bf930e0
commit 6ed8e71b41

@ -2,7 +2,10 @@ name: "Build And Release"
on: on:
push: push:
tags: [ "*" ] branches:
- master
tags:
- "*"
jobs: jobs:
# job 1 # job 1
@ -45,28 +48,20 @@ jobs:
echo "github.ref = ${{ github.ref }}"; echo "github.ref = ${{ github.ref }}";
echo "github.ref_name = ${{ github.ref_name }}"; echo "github.ref_name = ${{ github.ref_name }}";
- name: "npm install lerna/yarn" - name: "npm install lerna/yarn -g"
run: | run: |
echo "======================================================================";
dir || ls -lah;
echo "======================================================================"; echo "======================================================================";
echo "npm install lerna@${{ matrix.lerna }} -g"; echo "npm install lerna@${{ matrix.lerna }} -g";
echo "--------------------"; echo "--------------------";
npm install lerna@${{ matrix.lerna }} -g; npm install lerna@${{ matrix.lerna }} -g;
echo "======================================================================"; echo "======================================================================";
echo "npm install yarn"; echo "npm install yarn -g";
echo "--------------------"; echo "--------------------";
npm install yarn; npm install yarn -g;
- name: "npm -v | lerna -v | yarn -v" - name: "npm -v | yarn -v | lerna -v"
run: | run: |
echo "======================================================================";
echo "lerna -v";
echo "--------------------";
lerna -v;
echo "======================================================================"; echo "======================================================================";
echo "npm -v"; echo "npm -v";
echo "--------------------"; echo "--------------------";
@ -77,6 +72,11 @@ jobs:
echo "--------------------"; echo "--------------------";
yarn -v; yarn -v;
echo "======================================================================";
echo "lerna -v";
echo "--------------------";
lerna -v;
- name: "lerna bootstrap" - name: "lerna bootstrap"
run: | run: |
echo "======================================================================"; echo "======================================================================";
@ -89,9 +89,6 @@ jobs:
- name: "npm run electron:build" - name: "npm run electron:build"
run: | run: |
echo "======================================================================";
dir || ls -lah;
echo "======================================================================"; echo "======================================================================";
echo "cd packages/gui"; echo "cd packages/gui";
echo "--------------------"; echo "--------------------";
@ -116,28 +113,28 @@ jobs:
dir || ls -lah; dir || ls -lah;
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.exe" - name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.exe"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4.4.0
if: ${{ matrix.os == 'windows-latest' }} if: ${{ matrix.os == 'windows-latest' }}
with: with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.exe path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.exe
name: "DevSidecar-${{ steps.package-info.outputs.version }}.exe" name: "DevSidecar-${{ steps.package-info.outputs.version }}.exe"
if-no-files-found: error if-no-files-found: error
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.deb" - name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.deb"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4.4.0
if: ${{ matrix.os == 'ubuntu-latest' }} if: ${{ matrix.os == 'ubuntu-latest' }}
with: with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.deb path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.deb
name: "DevSidecar-${{ steps.package-info.outputs.version }}.deb" name: "DevSidecar-${{ steps.package-info.outputs.version }}.deb"
if-no-files-found: error if-no-files-found: error
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.AppImage" - name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.AppImage"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4.4.0
if: ${{ matrix.os == 'ubuntu-latest' }} if: ${{ matrix.os == 'ubuntu-latest' }}
with: with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage
name: "DevSidecar-${{ steps.package-info.outputs.version }}.AppImage" name: "DevSidecar-${{ steps.package-info.outputs.version }}.AppImage"
if-no-files-found: error if-no-files-found: error
- name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.dmg " - name: "Upload DevSidecar-${{ steps.package-info.outputs.version }}.dmg "
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4.4.0
if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-12' || matrix.os == 'macos-13' || matrix.os == 'macos-latest' }} if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-12' || matrix.os == 'macos-13' || matrix.os == 'macos-latest' }}
with: with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.dmg path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.dmg
@ -163,35 +160,36 @@ jobs:
run: mkdir release run: mkdir release
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.exe" - name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.exe"
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4.1.8
with: with:
name: DevSidecar-${{ steps.package-info.outputs.version }}.exe name: DevSidecar-${{ steps.package-info.outputs.version }}.exe
path: release path: release
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.deb" - name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.deb"
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4.1.8
with: with:
name: DevSidecar-${{ steps.package-info.outputs.version }}.deb name: DevSidecar-${{ steps.package-info.outputs.version }}.deb
path: release path: release
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.AppImage" - name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.AppImage"
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4.1.8
with: with:
name: DevSidecar-${{ steps.package-info.outputs.version }}.AppImage name: DevSidecar-${{ steps.package-info.outputs.version }}.AppImage
path: release path: release
- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.dmg" - name: "Download DevSidecar-${{ steps.package-info.outputs.version }}.dmg"
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4.1.8
with: with:
name: DevSidecar-${{ steps.package-info.outputs.version }}.dmg name: DevSidecar-${{ steps.package-info.outputs.version }}.dmg
path: release path: release
- name: "Print" - name: "Print files from 'release' dir"
run: | run: |
ls -lah release; ls -lah release;
- name: "Create a draft release" - name: "Create a draft release"
uses: fnkr/github-action-ghr@ghr-options uses: fnkr/github-action-ghr@ghr-options
if: ${{ github.ref_type == 'tag' }}
env: env:
GHR_PATH: release/
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
GHR_PATH: release/
GHR_TITLE: ${{ github.ref_name }}
GHR_REPLACE: true GHR_REPLACE: true
GHR_TITLE: ${{ steps.package-info.outputs.version }}
GHR_DRAFT: true GHR_DRAFT: true

@ -367,7 +367,7 @@ cd dev-sidecar
# 注意不要使用 `npm install` 来安装依赖,因为 `lerna bootstrap` 会自动安装依赖 # 注意不要使用 `npm install` 来安装依赖,因为 `lerna bootstrap` 会自动安装依赖
lerna bootstrap lerna bootstrap
# 如果 `lerna bootstrap` 有报错可以尝试执行如下两行命令用yarn替换掉npm # 如果 `lerna bootstrap` 有报错可以尝试执行如下两行命令用yarn替换掉npm
#cnpm install yarn #cnpm install yarn -g
#lerna bootstrap --npm-client=yarn #lerna bootstrap --npm-client=yarn
# 运行DevSidecar # 运行DevSidecar

Loading…
Cancel
Save