add teamid export step #117
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 | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest-large, windows-latest, macos-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build React app | |
env: | |
CI: false | |
run: npm run react-build | |
# --------------------------- | |
# macOS Build | |
# --------------------------- | |
- name: Debug environment (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "===== DEBUGGING ENVIRONMENT =====" | |
echo "API Key ID: [MASKED]" | |
echo "API Issuer: [MASKED]" | |
echo "Certificate: [MASKED]" | |
echo "=================================" | |
- name: Setup macOS certificates | |
if: matrix.os == 'macos-latest' | |
env: | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
run: | | |
# Create keychain | |
security create-keychain -p "" build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p "" build.keychain | |
# Import certificate | |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | |
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PASSWORD -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" build.keychain | |
# Clean up | |
rm certificate.p12 | |
- name: Build and Sign Electron app (macOS) | |
if: matrix.os == 'macos-latest' | |
env: | |
DEBUG: electron-builder,electron-builder:* | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Apple notarization credentials (API Key method) | |
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | |
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} | |
APPLE_API_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} | |
# Signing certificate | |
CSC_LINK: ${{ secrets.MACOS_CERTIFICATE }} | |
CSC_KEY_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} | |
run: | | |
# Show electron-builder version | |
npx electron-builder --version | |
# Pre-sign any nested binaries (similar to the bash script) | |
find . -type f -path "*/Resources/*/bin/*" -exec codesign --force --sign "$APPLE_API_ISSUER" --options runtime {} \; | |
# Build with electron-builder | |
npx electron-builder --mac --x64 --arm64 --publish=never | |
# Verify signing and notarization for both architectures | |
echo "Verifying x64 build..." | |
spctl --assess --verbose=4 "dist/mac-universal/Drivechain Launcher.app" | |
xcrun stapler validate "dist/mac-universal/Drivechain Launcher.app" | |
echo "Verifying arm64 build..." | |
spctl --assess --verbose=4 "dist/mac-arm64/Drivechain Launcher.app" | |
xcrun stapler validate "dist/mac-arm64/Drivechain Launcher.app" | |
# --------------------------- | |
# Windows Build | |
# --------------------------- | |
- name: Build Electron app (Windows) | |
if: matrix.os == 'windows-latest' | |
env: | |
DEBUG: electron-builder | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm run electron-build | |
# --------------------------- | |
# Linux Build | |
# --------------------------- | |
- name: Build Electron app (Linux) | |
if: matrix.os == 'ubuntu-latest-large' | |
env: | |
DEBUG: electron-builder | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npx electron-builder --version | |
ls -la | |
npx electron-builder --linux AppImage --x64 | |
ls -la dist/ | |
# --------------------------- | |
# Upload Artifacts | |
# --------------------------- | |
- name: Check Linux build output | |
if: matrix.os == 'ubuntu-latest-large' | |
run: | | |
echo "Checking build output..." | |
if [ ! -d "dist" ]; then | |
echo "Error: dist directory not found" | |
exit 1 | |
fi | |
find dist -type f -name "*.AppImage" || echo "No AppImage files found in dist/" | |
- name: Upload Linux artifacts | |
if: matrix.os == 'ubuntu-latest-large' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-build | |
path: dist/*.AppImage | |
if-no-files-found: error | |
- name: Upload Windows artifacts | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-build | |
path: dist/*.exe | |
if-no-files-found: error | |
- name: Upload macOS artifacts | |
if: matrix.os == 'macos-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-build | |
path: dist/*.dmg | |
if-no-files-found: error | |
# ---------------------------------- | |
# Upload to your server step | |
# ---------------------------------- | |
upload-to-releases: | |
name: Upload to releases.drivechain.info | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: github.event_name == 'push' && github.repository_owner == 'LayerTwo-Labs' | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: "*-build" | |
path: artifacts | |
- name: List downloaded files | |
run: | | |
echo "Artifacts directory contents:" | |
ls -la artifacts | |
echo "Linux build directory contents:" | |
ls -la artifacts/linux-build | |
echo "Windows build directory contents:" | |
ls -la artifacts/windows-build | |
echo "macOS build directory contents:" | |
ls -la artifacts/macos-build | |
- name: Process artifacts | |
run: | | |
# (Linux) rename AppImage | |
cd artifacts/linux-build | |
mv *.AppImage ../../drivechain-launcher-latest-x86_64-linux.AppImage | |
cd ../.. | |
# (Windows) zip up the .exe | |
cd artifacts/windows-build | |
EXE_FILE=$(ls Drivechain-Launcher-Setup-*.exe 2>/dev/null || echo "") | |
if [ -z "$EXE_FILE" ]; then | |
echo "Error: No Windows exe file found" | |
exit 1 | |
fi | |
zip ../../drivechain-launcher-latest-windows.zip "$EXE_FILE" | |
cd ../.. | |
# (macOS) rename the DMGs | |
cd artifacts/macos-build | |
ARM64_DMG=$(ls *-arm64.dmg 2>/dev/null || echo "") | |
if [ -z "$ARM64_DMG" ]; then | |
echo "Error: No arm64 DMG file found" | |
exit 1 | |
fi | |
mv "$ARM64_DMG" ../../drivechain-launcher-latest-osx-arm64.dmg | |
X64_DMG=$(ls *-x64.dmg 2>/dev/null || echo "") | |
if [ -z "$X64_DMG" ]; then | |
echo "Error: No x64 DMG file found" | |
exit 1 | |
fi | |
mv "$X64_DMG" ../../drivechain-launcher-latest-osx-x64.dmg | |
cd ../.. | |
echo "Final files:" | |
ls -la drivechain-launcher-* | |
- name: Verify files exist | |
run: | | |
if [ ! -f "drivechain-launcher-latest-x86_64-linux.AppImage" ]; then | |
echo "Error: Linux AppImage file not found" | |
exit 1 | |
fi | |
if [ ! -f "drivechain-launcher-latest-windows.zip" ]; then | |
echo "Error: Windows zip file not found" | |
exit 1 | |
fi | |
if [ ! -f "drivechain-launcher-latest-osx-arm64.dmg" ]; then | |
echo "Error: macOS arm64 DMG file not found" | |
exit 1 | |
fi | |
if [ ! -f "drivechain-launcher-latest-osx-x64.dmg" ]; then | |
echo "Error: macOS x64 DMG file not found" | |
exit 1 | |
fi | |
- name: Upload to releases.drivechain.info | |
uses: cross-the-world/ssh-scp-ssh-pipelines@latest | |
with: | |
host: 45.33.96.47 | |
user: root | |
pass: ${{ secrets.RELEASES_SERVER_PW }} | |
port: 22 | |
scp: | | |
'drivechain-launcher-latest-x86_64-linux.AppImage' => '/var/www/html/' | |
'drivechain-launcher-latest-windows.zip' => '/var/www/html/' | |
'drivechain-launcher-latest-osx-arm64.dmg' => '/var/www/html/' | |
'drivechain-launcher-latest-osx-x64.dmg' => '/var/www/html/' |