Skip to content

Disable windows

Disable windows #70

Workflow file for this run

name: 'release'
on:
push:
tags:
- 'v*.*.*'
jobs:
publish-electron:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # Universal binary for both Intel and Apple Silicon
args: '--mac'
- platform: 'ubuntu-22.04'
args: '--linux'
# - platform: 'windows-2022'
# args: '--win'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Delete existing draft releases for this version
if: github.event_name == 'push'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
# Get version from package.json
VERSION=$(node -p "require('./package.json').version")
# Delete any existing draft release with this version
gh release list --limit 100 | grep "Draft" | grep "v$VERSION" | awk '{print $1}' | xargs -I {} gh release delete {} --yes || true
continue-on-error: true
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y librsvg2-dev rpm
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install frontend dependencies
run: npm install
- name: import Apple Developer Certificate
if: matrix.platform == 'macos-latest'
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_CERT }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_CERT_PASS }}
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -t 3600 -u build.keychain
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
security find-identity -v -p codesigning build.keychain
- name: verify certificate
if: matrix.platform == 'macos-latest'
id: verify_certificate
run: |
CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "BSV")
echo "CERT_INFO=$CERT_INFO"
CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
echo "cert_id=$CERT_ID" >> $GITHUB_OUTPUT
echo "Certificate imported."
- name: build and publish Electron app (macOS)
if: matrix.platform == 'macos-latest'
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_SIGNING_IDENTITY: ${{ steps.verify_certificate.outputs.cert_id }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run build
npx electron-builder --mac --publish never
- name: Upload macOS artifacts
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: |
release/*.dmg
release/*.zip
release/*.yml
# === Linux Build and Packaging ===
- name: build and publish Electron app (Linux)
if: matrix.platform == 'ubuntu-22.04'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run build
npx electron-builder --linux --publish never
- name: Import GPG Key for Linux Signing
if: matrix.platform == 'ubuntu-22.04'
env:
GPG_PRIVATE_KEY: ${{ secrets.APP_IMAGE_GPG_KEY }}
run: |
echo "$GPG_PRIVATE_KEY" | gpg --import
- name: Sign Linux AppImage with GPG
if: matrix.platform == 'ubuntu-22.04'
run: |
# Find the AppImage file
APPIMAGE=$(find release -name "*.AppImage" -type f | head -n 1)
if [ -n "$APPIMAGE" ]; then
gpg --detach-sign --armor "$APPIMAGE"
fi
- name: Create and Sign SHA256SUMS (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
cd release
sha256sum *.AppImage *.deb *.rpm > SHA256SUMS 2>/dev/null || true
if [ -f SHA256SUMS ]; then
gpg --detach-sign --armor SHA256SUMS
fi
- name: Upload Linux Artifacts
if: matrix.platform == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
release/*.AppImage
release/*.AppImage.asc
release/*.deb
release/*.rpm
release/*.yml
release/SHA256SUMS
release/SHA256SUMS.asc
# === Windows Build and Signing ===
- name: Set up DigiCert client certificate
if: matrix.platform == 'windows-2022'
run: |
echo "${{ secrets.DIGICERT_CLIENT_AUTH_CERT }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash
- name: Setup DigiCert Software Trust Manager
if: matrix.platform == 'windows-2022'
uses: digicert/code-signing-software-trust-action@v1
with:
simple-signing-mode: true
env:
SM_HOST: ${{ secrets.DIGICERT_HOST }}
SM_API_KEY: ${{ secrets.DIGICERT_KEY_LOCKER_API_KEY }}
SM_CLIENT_CERT_FILE: D:\Certificate_pkcs12.p12
SM_CLIENT_CERT_PASSWORD: ${{ secrets.DIGICERT_CLIENT_AUTH_PASS }}
- name: build and sign Electron app (Windows)
if: matrix.platform == 'windows-2022'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SM_HOST: ${{ secrets.DIGICERT_HOST }}
SM_API_KEY: ${{ secrets.DIGICERT_KEY_LOCKER_API_KEY }}
SM_CLIENT_CERT_FILE: D:\Certificate_pkcs12.p12
SM_CLIENT_CERT_PASSWORD: ${{ secrets.DIGICERT_CLIENT_AUTH_PASS }}
SM_KEYPAIR_ALIAS: ${{ secrets.DIGICERT_KEYPAIR_ALIAS }}
run: |
npm run build
npx electron-builder --win --publish never
- name: Upload Windows Artifacts
if: matrix.platform == 'windows-2022'
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
release/*.exe
release/*.yml
if-no-files-found: warn
- name: List Windows build artifacts for debugging
if: matrix.platform == 'windows-2022'
shell: powershell
run: |
Write-Host "Checking build directory structure:"
Get-ChildItem -Path release -Recurse | Where-Object { $_.Name -like "*.exe" } | ForEach-Object { $_.FullName }
create-release:
needs: publish-electron
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create GitHub Release and Upload Assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
# Create release if it doesn't exist (will be draft)
gh release create "$TAG" --draft --title "BSV Desktop v${VERSION}" --notes "Release v${VERSION}" || true
# Upload all artifacts
for dir in artifacts/*/; do
for file in "$dir"*; do
if [ -f "$file" ]; then
gh release upload "$TAG" "$file" --clobber
fi
done
done