SocketCan Arm64 #37
Workflow file for this run
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 Electron App | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build on ${{ matrix.platform }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [armv7l, arm64, x64] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildxarm64 | |
uses: docker/setup-buildx-action@v1 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20.11.0" | |
- name: Install dependencies | |
run: npm install | |
- name: Configure Pre-Built Native Modules | |
run: | | |
echo "Configuring pre-built SocketCan modules..." | |
mkdir -p node_modules/socketcan/build/Release | |
if [ "${{ matrix.platform }}" = "armv7l" ]; then | |
cp prebuilt/socketcan/can-armv7l.node node_modules/socketcan/build/Release/can.node | |
cp prebuilt/socketcan/can_signals-armv7l.node node_modules/socketcan/build/Release/can_signals.node | |
elif [ "${{ matrix.platform }}" = "arm64" ]; then | |
cp prebuilt/socketcan/can-arm64.node node_modules/socketcan/build/Release/can.node | |
cp prebuilt/socketcan/can_signals-arm64.node node_modules/socketcan/build/Release/can_signals.node | |
elif [ "${{ matrix.platform }}" = "x64" ]; then | |
cp prebuilt/socketcan/can-x64.node node_modules/socketcan/build/Release/can.node | |
cp prebuilt/socketcan/can_signals-x64.node node_modules/socketcan/build/Release/can_signals.node | |
fi | |
- name: Extract version | |
run: echo "VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV | |
- name: Build Electron App | |
run: CI=false npm run build:linux -- --${{ matrix.platform }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: FLos-${{ matrix.platform }}-${{ env.VERSION }}.AppImage | |
path: dist/*.AppImage | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload 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: ./FLos-${{ matrix.platform }}-${{ env.VERSION }}.AppImage | |
asset_name: FLos-${{ matrix.platform }}-${{ env.VERSION }}.AppImage | |
asset_content_type: application/octet-stream |