Skip to content

Commit

Permalink
Merge branch 'iNavFlight:master' into changeCalibrationTab
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioCesarMatias authored Jul 10, 2024
2 parents 67b115f + 66489d2 commit 4f2207e
Show file tree
Hide file tree
Showing 34 changed files with 965 additions and 849 deletions.
137 changes: 112 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ name: Build Configurator
# Don't enable CI on push, just on PR. If you
# are working on the main repo and want to trigger
# a CI build submit a draft PR.
on: pull_request
on:
pull_request:

workflow_call:
#inputs:
# release_build:
# description: 'Specifies if it is a build that should include commit hash in hex file names or not'
# default: false
# required: false
# type: boolean

jobs:
build-linux:
Expand Down Expand Up @@ -34,7 +43,7 @@ jobs:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install dpkg fakeroot rpm build-essential libudev-dev
- name: Install deps
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
Expand All @@ -43,20 +52,70 @@ jobs:
- name: Build Linux
run: npm run make
- name: Upload Linux deb
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }}_DEB
path: ./out/make/deb/x64/*.deb
- name: Upload Linux rpm
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }}_RPM
path: ./out/make/rpm/x64/*.rpm
- name: Upload Linux zip
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_NAME }}_ZIP
path: ./out/make/zip/linux/x64/*.zip


build-mac-arm64:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEarm64=inav-configurator_darwin_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: 'npm'
# Workaround due to a bug in node-gyp: https://github.com/electron/rebuild/issues/1116
- name: Install Setuptools
run: python3 -m pip install --break-system-packages setuptools
- name: Install deps
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build MacOS arm64
run: npm run make -- --arch="arm64"
- name: Upload MacOS arm64 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_ZIP
path: ./out/make/zip/darwin/arm64/*.zip
- name: Upload MacOS arm64 dmg
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_DMG
path: ./out/make/*arm64*.dmg

build-mac:
runs-on: macos-13
steps:
Expand All @@ -77,7 +136,6 @@ jobs:
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEx64=inav-configurator_darwin_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEarm64=inav-configurator_darwin_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 20
Expand All @@ -87,16 +145,14 @@ jobs:
- name: Install Setuptools
run: python3 -m pip install --break-system-packages setuptools
- name: Install deps
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build MacOS x64
run: npm run make -- --arch="x64"
- name: Build MacOS arm64
run: npm run make -- --arch="arm64"
- name: Upload MacOS x64 zip
uses: actions/upload-artifact@v4
with:
Expand All @@ -107,16 +163,7 @@ jobs:
with:
name: ${{env.BUILD_NAMEx64}}_DMG
path: ./out/make/*x64*.dmg
- name: Upload MacOS arm64 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_ZIP
path: ./out/make/zip/darwin/arm64/*.zip
- name: Upload MacOS arm64 dmg
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_DMG
path: ./out/make/*arm64*.dmg

build-windows:
runs-on: windows-latest
steps:
Expand All @@ -140,7 +187,6 @@ jobs:
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEx64=inav-configurator_win32_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEia32=inav-configurator_win32_ia32_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-node@v4
with:
Expand All @@ -152,16 +198,14 @@ jobs:
url: "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"
pathInArchive: "/"
- name: Install deps
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build Win32 x64
- name: Build Win x64
run: npm run make -- --arch="x64"
- name: Build win32 ia32
run: npm run make -- --arch="ia32"
- name: Upload Windows x64 zip
uses: actions/upload-artifact@v4
with:
Expand All @@ -172,6 +216,49 @@ jobs:
with:
name: ${{env.BUILD_NAMEx64}}_MSI
path: ./out/make/wix/x64/*.msi

build-windows-win32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install linux utils
run: choco install --force -y awk grep sed
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEia32=inav-configurator_win32_ia32_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- uses: engineerd/[email protected]
with:
name: "Wix Toolset 3.1.4"
url: "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"
pathInArchive: "/"
- name: Install deps
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build Win32
run: npm run make -- --arch="ia32"
- name: Upload Windows ia32 zip
uses: actions/upload-artifact@v4
with:
Expand All @@ -182,4 +269,4 @@ jobs:
with:
name: ${{env.BUILD_NAMEia32}}_MSI
path: ./out/make/wix/ia32/*.msi

62 changes: 62 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build pre-release

on:
push:
branches:
- master
# pull_request:

jobs:
build:
name: build
uses: ./.github/workflows/ci.yml

release:
name: Build nightly-release
runs-on: ubuntu-latest
needs: [build]

steps:
- name: Get current date
id: date
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
- name: Code Checkout
uses: actions/checkout@v4
- name: Fetch build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Upload release artifacts
uses: softprops/action-gh-release@v2
with:
name: inav-configurator-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
# To create release on a different repo, we need a token setup
token: ${{ secrets.NIGHTLY_TOKEN }}
repository: iNavFlight/inav-configurator-nightly
prerelease: true
draft: false
#generate_release_notes: true
make_latest: false
files: |
artifacts/*
body: |
${{ steps.notes.outputs.notes }}
### MacOS builds
MacOS builds are not signed, so you will need to run ```xattr -cr /path/to/your/INAV Configurator.app``` from the command line to remove the warnings about it being a downloaded application or moving it to trash when trying to launch.
### Repository:
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))

### Branch:
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))

### Latest changeset:
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))

### Changes:
${{ github.event.head_commit.message }}

9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ inav-configurator.iml
/out
.eslintrc.json
/.project
/cache/
/dist/
/apps/
/build/
*~
*.swp
*.bak
eeprom.bin
yarn.lock
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sudo mv inav-configurator.desktop /usr/share/applications/
For local development, the **node.js** build system is used.

1. Install node.js
1. From the project folder run `npm install`
1. From the project folder run `yarn install` and then `npm install`
1. To build the and start the configurator:
- Run `npm start`.

Expand Down Expand Up @@ -111,7 +111,7 @@ Example (note the double -- ):

### Running with debug | Inspector

To be able to open Inspector, set envorinment variable `NODE_ENV` to `develpoment` or set the flag directly when run `npm start`:
To be able to open Inspector, set environment variable `NODE_ENV` to `development` or set the flag directly when run `npm start`:

```NODE_ENV=development npm start``` or ```$env:NODE_ENV="development" | npm start``` for Windows PowerShell

Expand Down
Loading

0 comments on commit 4f2207e

Please sign in to comment.