Skip to content

Commit

Permalink
optimize: 优化 Github Actions,发布文件名拼接操作系统名。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Dec 12, 2024
1 parent 65ea136 commit 0a151a2
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 79 deletions.
121 changes: 74 additions & 47 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,77 +112,104 @@ jobs:
echo "--------------------";
npm run electron:build;
- name: 'Print dir "packages/gui/dist_electron/"'
run: |
echo "======================================================================";
echo "cd dist_electron";
echo "cd packages/gui/dist_electron";
echo "--------------------";
cd dist_electron;
cd packages/gui/dist_electron;
dir || ls -lah;
echo "======================================================================";
echo "cd ../../../";
echo "--------------------";
cd ../../../;
dir || ls -lah;
# Rename artifacts
- name: 'Rename artifacts - Windows'
if: ${{ matrix.os == 'windows' }}
run: |
cd packages/gui/dist_electron;
ren DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe;
ren DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe;
ren DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe;
dir;
- name: 'Rename artifacts - Linux'
if: ${{ matrix.os == 'ubuntu' }}
run: |
cd packages/gui/dist_electron;
mv DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb;
mv DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb;
mv DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage;
mv DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage;
ls -lah;
- name: 'Rename artifacts - macOS'
if: ${{ matrix.os == 'macos' }}
run: |
cd packages/gui/dist_electron;
mv DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg;
ls -lah;
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe - Windows'
#region Upload artifacts - Windows
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe'
uses: actions/[email protected]
if: ${{ matrix.os == 'windows' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe'
if-no-files-found: error
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe - Windows'
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe'
uses: actions/[email protected]
if: ${{ matrix.os == 'windows' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe'
if-no-files-found: error
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe - Windows'
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe'
uses: actions/[email protected]
if: ${{ matrix.os == 'windows' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe'
if-no-files-found: error
#endregion Upload artifacts - Windows

- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb - Ubuntu'
#region Upload artifacts - Linux
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb'
uses: actions/[email protected]
if: ${{ matrix.os == 'ubuntu' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb'
if-no-files-found: error
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb - Ubuntu'
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb'
uses: actions/[email protected]
if: ${{ matrix.os == 'ubuntu' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb'
if-no-files-found: error
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage - Ubuntu'
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage'
uses: actions/[email protected]
if: ${{ matrix.os == 'ubuntu' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage'
if-no-files-found: error
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage - Ubuntu'
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage'
uses: actions/[email protected]
if: ${{ matrix.os == 'ubuntu' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage'
if-no-files-found: error
#endregion Upload artifacts - Linux

- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg - Mac'
# Upload artifacts - macOS
- name: 'Upload DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg'
uses: actions/[email protected]
if: ${{ matrix.os == 'macos' }}
with:
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg'
path: packages/gui/dist_electron/DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg'
if-no-files-found: error


# job 2
download-and-release:
runs-on: ubuntu-latest
Expand All @@ -202,47 +229,47 @@ jobs:
run: mkdir release

# Download artifacts
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe - Windows'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-ia32.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-ia32.exe'
path: release
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe - Windows'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-x64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-x64.exe'
path: release
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe - Windows'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-arm64.exe
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-windows-arm64.exe'
path: release

- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb - Ubuntu'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-amd64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-amd64.deb'
path: release
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb - Ubuntu'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-arm64.deb
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.deb'
path: release
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage - Ubuntu'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-x86_64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.AppImage'
path: release
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage - Ubuntu'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-arm64.AppImage
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-linux-arm64.AppImage'
path: release

- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg - Mac'
- name: 'Download DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg'
uses: actions/[email protected]
with:
name: DevSidecar-${{ steps.package-info.outputs.version }}-universal.dmg
name: 'DevSidecar-${{ steps.package-info.outputs.version }}-macos-universal.dmg'
path: release

- name: 'Print files from "release" dir'
Expand Down
Loading

0 comments on commit 0a151a2

Please sign in to comment.