Skip to content

Commit

Permalink
chore: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 committed Jul 2, 2024
1 parent a61cab6 commit 084d003
Showing 1 changed file with 106 additions and 5 deletions.
111 changes: 106 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:

- name: Install dependencies
run: pnpm install
- name: Get version from package.json
id: get_version
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV

- name: Build Electron App
run: |
Expand All @@ -33,10 +36,108 @@ jobs:
fi
shell: bash

- name: Upload Artifact
# - name: Upload Artifact
# uses: actions/upload-artifact@v2
# with:
# name: fideo-${{ runner.os }}
# path: |
# dist/*.exe
# dist/*.dmg
- name: Archive Windows build artifacts
if: ${{ runner.os == 'Windows' }}
run: zip -r fideo-win-${{ env.VERSION }}.zip dist/fideo-${{ env.VERSION }}.exe

- name: Archive macOS build artifacts (x64)
if: ${{ runner.os == 'macOS' }}
run: tar -czf fideo-mac-x64-${{ env.VERSION }}.tar.gz dist/fideo-${{ env.VERSION }}-x64.dmg

- name: Archive macOS build artifacts (arm)
if: ${{ runner.os == 'macOS' }}
run: tar -czf fideo-mac-arm-${{ env.VERSION }}.tar.gz dist/fideo-${{ env.VERSION }}-arm.dmg

- name: Upload Windows build artifact
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v2
with:
name: electron-app-${{ runner.os }}
path: |
dist/*.exe
dist/*.dmg
name: build-win-${{ env.VERSION }}
path: fideo-win-${{ env.VERSION }}.zip

- name: Upload macOS build artifacts (x64)
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v2
with:
name: build-mac-x64-${{ env.VERSION }}
path: fideo-mac-x64-${{ env.VERSION }}.tar.gz

- name: Upload macOS build artifacts (arm)
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v2
with:
name: build-mac-arm-${{ env.VERSION }}
path: fideo-mac-arm-${{ env.VERSION }}.tar.gz

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download Windows build artifact
uses: actions/download-artifact@v2
with:
name: build-win-${{ env.VERSION }}
path: .

- name: Download macOS build artifacts (x64)
uses: actions/download-artifact@v2
with:
name: build-mac-x64-${{ env.VERSION }}
path: .

- name: Download macOS build artifacts (arm)
uses: actions/download-artifact@v2
with:
name: build-mac-arm-${{ env.VERSION }}
path: .

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
draft: false
prerelease: false

- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: fideo-win-${{ env.VERSION }}.zip
asset_name: fideo-win-${{ env.VERSION }}.zip
asset_content_type: application/zip

- name: Upload macOS Release Asset (x64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: fideo-mac-x64-${{ env.VERSION }}.tar.gz
asset_name: fideo-mac-x64-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip

- name: Upload macOS Release Asset (arm)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: fideo-mac-arm-${{ env.VERSION }}.tar.gz
asset_name: fideo-mac-arm-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip

0 comments on commit 084d003

Please sign in to comment.