upgrade: 清理和升级依赖 #138
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: Test And Upload | |
on: | |
push: | |
branches: | |
- master | |
- release | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test-and-upload: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows | |
- ubuntu | |
- macos | |
node: | |
- 20 | |
- 22 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
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: | | |
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 }}"; | |
- name: 'npm -v | pnpm -v' | |
run: | | |
echo "======================================================================"; | |
echo "npm -v"; | |
echo "--------------------"; | |
npm -v; | |
echo "======================================================================"; | |
echo "pnpm -v"; | |
echo "--------------------"; | |
pnpm -v; | |
- name: pnpm Install | |
run: | | |
echo "======================================================================"; | |
dir || ls -lah; | |
echo "======================================================================"; | |
echo "pnpm install"; | |
echo "--------------------"; | |
pnpm install; | |
- name: 'npm run electron:build' | |
env: | |
NODE_OPTIONS: --openssl-legacy-provider | |
run: | | |
echo "======================================================================"; | |
echo "cd packages/gui"; | |
echo "--------------------"; | |
cd packages/gui; | |
dir || ls -lah; | |
echo "======================================================================"; | |
echo "npm run electron:build"; | |
echo "--------------------"; | |
npm run electron:build; | |
echo "======================================================================"; | |
echo "cd dist_electron"; | |
echo "--------------------"; | |
cd dist_electron; | |
dir || ls -lah; | |
echo "======================================================================"; | |
echo "cd ../../../"; | |
echo "--------------------"; | |
cd ../../../; | |
dir || ls -lah; | |
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe - Windows' | |
uses: actions/[email protected] | |
if: ${{ matrix.os == 'windows' }} | |
with: | |
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.exe | |
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.exe' | |
if-no-files-found: error | |
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.deb - Ubuntu' | |
uses: actions/[email protected] | |
if: ${{ matrix.os == 'ubuntu' }} | |
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] | |
if: ${{ matrix.os == 'ubuntu' }} | |
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 | |
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg - Mac' | |
uses: actions/[email protected] | |
if: ${{ matrix.os == 'macos' }} | |
with: | |
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}.dmg | |
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-node${{ matrix.node }}.dmg' | |
if-no-files-found: error | |
# job 2 | |
download-and-release: | |
if: ${{ github.ref_name == 'release' }} | |
runs-on: ubuntu-latest | |
needs: | |
- test-and-upload | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Get package info | |
id: package-info | |
uses: luizfelipelaviola/get-package-info@v1 | |
with: | |
path: ./packages/mitmproxy | |
- name: 'Make ''release'' dir' | |
run: mkdir release | |
# Download artifacts with node16 | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe - Windows' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb - Ubuntu' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage - Ubuntu' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg - Mac' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg | |
path: release | |
- name: 'Rename ''release/DevSidecar-${{ steps.package-info.outputs.version }}.*'' to ''release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.*''' | |
run: | | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.exe; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.deb; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.AppImage; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node16.dmg; | |
# Download artifacts with node17 | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe - Windows' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb - Ubuntu' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage - Ubuntu' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage | |
path: release | |
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg - Mac' | |
uses: actions/[email protected] | |
with: | |
name: DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg | |
path: release | |
- name: 'Rename ''release/DevSidecar-${{ steps.package-info.outputs.version }}.*'' to ''release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.*''' | |
run: | | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.exe release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.exe; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.deb release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.deb; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.AppImage release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.AppImage; | |
mv release/DevSidecar-${{ steps.package-info.outputs.version }}.dmg release/DevSidecar-${{ steps.package-info.outputs.version }}-node17.dmg; | |
- name: 'Print files from ''release'' dir' | |
run: | | |
ls -lah release; | |
- name: Create a draft release | |
uses: wangliang181230/github-action-ghr@master | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
GHR_PATH: release/ | |
GHR_TITLE: ${{ github.ref_name }} | |
GHR_REPLACE: true | |
GHR_DRAFT: true |