chore: update release.yml #74
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: Build and Release fideo | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install PNPM | |
run: npm install -g pnpm | |
- 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 | |
shell: bash | |
- name: Build Electron App | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
pnpm build:win | |
elif [ "${{ runner.os }}" == "macOS" ]; then | |
pnpm build:mac | |
fi | |
shell: bash | |
- name: Upload Windows build artifact (x64) | |
if: ${{ runner.os == 'Windows' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-win-x64-${{ env.VERSION }} | |
path: dist/fideo-${{ env.VERSION }}-x64.exe | |
- name: Upload Windows build artifact (arm64) | |
if: ${{ runner.os == 'Windows' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-win-arm64-${{ env.VERSION }} | |
path: dist/fideo-${{ env.VERSION }}-arm64.exe | |
- name: Upload macOS build artifacts (x64) | |
if: ${{ runner.os == 'macOS' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-mac-x64-${{ env.VERSION }} | |
path: dist/fideo-${{ env.VERSION }}-x64.dmg | |
- name: Upload macOS build artifacts (arm) | |
if: ${{ runner.os == 'macOS' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-mac-arm-${{ env.VERSION }} | |
path: dist/fideo-${{ env.VERSION }}-arm64.dmg | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get version from package.json | |
id: get_version | |
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV | |
- name: Download Windows build artifact (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-win-x64-${{ env.VERSION }} | |
path: . | |
- name: Download Windows build artifact (arm64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-win-arm64-${{ env.VERSION }} | |
path: . | |
- name: Download macOS build artifacts (x64) | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-mac-x64-${{ env.VERSION }} | |
path: . | |
- name: Download macOS build artifacts (arm) | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-mac-arm-${{ env.VERSION }} | |
path: . | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
with: | |
files: | | |
fideo-${{ env.VERSION }}-x64.dmg | |
fideo-${{ env.VERSION }}-arm64.dmg | |
fideo-${{ env.VERSION }}-x64.exe | |
fideo-${{ env.VERSION }}-arm64.exe | |
tag_name: v${{ env.VERSION }} |