Skip to content

Build and Release

Build and Release #5

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Build Electron app
run: npm run package-${{ matrix.os }}
- name: Zip assets
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
zip -r GPG-Bridge-mac.zip GPG-Bridge-darwin-*
elif [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
zip -r GPG-Bridge-linux.zip GPG-Bridge-linux-*
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
powershell Compress-Archive -Path GPG-Bridge-win32-* -DestinationPath GPG-Bridge-win.zip
fi
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./GPG-Bridge-${{ matrix.os == 'macos-latest' && 'mac' || matrix.os == 'ubuntu-latest' && 'linux' || 'win' }}.zip
asset_name: GPG-Bridge-${{ matrix.os == 'macos-latest' && 'mac' || matrix.os == 'ubuntu-latest' && 'linux' || 'win' }}.zip
asset_content_type: application/zip
- name: Zip macOS Intel Asset
run: zip -j gpg-bridge-mac-intel.zip ./dist/gpg-bridge-mac-intel
- name: Upload macOS Intel Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gpg-bridge-mac-intel.zip
asset_name: gpg-bridge-mac-intel.zip
asset_content_type: application/zip
- name: Zip macOS ARM Asset
run: zip -j gpg-bridge-mac-arm.zip ./dist/gpg-bridge-mac-arm
- name: Upload macOS ARM Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gpg-bridge-mac-arm.zip
asset_name: gpg-bridge-mac-arm.zip
asset_content_type: application/zip
- name: Zip Linux x64 Asset
run: zip -j gpg-bridge-linux-x64.zip ./dist/gpg-bridge-linux-x64
- name: Upload Linux x64 Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gpg-bridge-linux-x64.zip
asset_name: gpg-bridge-linux-x64.zip
asset_content_type: application/zip
- name: Zip Linux ARM Asset
run: zip -j gpg-bridge-linux-arm.zip ./dist/gpg-bridge-linux-arm
- name: Upload Linux ARM Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gpg-bridge-linux-arm.zip
asset_name: gpg-bridge-linux-arm.zip
asset_content_type: application/zip