From 8c4fe34e9957a170a2880d1d2cfb5b18b99375e4 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:18:13 +0200 Subject: [PATCH 1/5] Attempt to build arm64 linux packages (rpi friendly) Will it work? --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf34fc2e..eb476b19b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,59 @@ jobs: name: ${{ env.BUILD_NAME }}_ZIP path: ./out/make/zip/linux/x64/*.zip + build-linux-arm64: + runs-on: [ubuntu-latest, arm64] + 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//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_NAME=inav-configurator_linux_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV + - uses: actions/setup-node@v4 + with: + node-version: 20 + check-latest: true + cache: 'npm' + - 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@v3 + with: + max_attempts: 3 + retry_on: error + command: npm install + timeout_minutes: 10 + - name: Build Linux + run: npm run make + - name: Upload Linux deb + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAME }}_ARM64_DEB + path: ./out/make/deb/*/*.deb + - name: Upload Linux rpm + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAME }}_ARM64_RPM + path: ./out/make/rpm/x64/*.rpm + - name: Upload Linux zip + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAME }}_ARM64_ZIP + path: ./out/make/zip/linux/*/*.zip + build-mac-arm64: runs-on: macos-13 From 67bbcedb90cc4216b8f9ae94b39a1abb786dc76d Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:47:53 +0200 Subject: [PATCH 2/5] checking --- .github/workflows/ci.yml | 104 +++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb476b19b..5b55e79ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,58 +67,58 @@ jobs: name: ${{ env.BUILD_NAME }}_ZIP path: ./out/make/zip/linux/x64/*.zip - build-linux-arm64: - runs-on: [ubuntu-latest, arm64] - 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//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_NAME=inav-configurator_linux_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV - - uses: actions/setup-node@v4 - with: - node-version: 20 - check-latest: true - cache: 'npm' - - 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@v3 - with: - max_attempts: 3 - retry_on: error - command: npm install - timeout_minutes: 10 - - name: Build Linux - run: npm run make - - name: Upload Linux deb - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BUILD_NAME }}_ARM64_DEB - path: ./out/make/deb/*/*.deb - - name: Upload Linux rpm - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BUILD_NAME }}_ARM64_RPM - path: ./out/make/rpm/x64/*.rpm - - name: Upload Linux zip - uses: actions/upload-artifact@v4 - with: - name: ${{ env.BUILD_NAME }}_ARM64_ZIP - path: ./out/make/zip/linux/*/*.zip + # build-linux-arm64: + # runs-on: [ubuntu-latest, arm64] + # 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//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_NAME=inav-configurator_linux_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV + # - uses: actions/setup-node@v4 + # with: + # node-version: 20 + # check-latest: true + # cache: 'npm' + # - 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@v3 + # with: + # max_attempts: 3 + # retry_on: error + # command: npm install + # timeout_minutes: 10 + # - name: Build Linux + # run: npm run make + # - name: Upload Linux deb + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BUILD_NAME }}_ARM64_DEB + # path: ./out/make/deb/*/*.deb + # - name: Upload Linux rpm + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BUILD_NAME }}_ARM64_RPM + # path: ./out/make/rpm/x64/*.rpm + # - name: Upload Linux zip + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ env.BUILD_NAME }}_ARM64_ZIP + # path: ./out/make/zip/linux/*/*.zip build-mac-arm64: From f4ea21f09f24b8eff0b98d0c32c4fe48ae6a599f Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:05:49 +0200 Subject: [PATCH 3/5] Re-enable. If it doesn't run, it is because arm is not available yet --- .github/workflows/ci.yml | 104 +++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b55e79ce..49d97ff55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,58 +67,58 @@ jobs: name: ${{ env.BUILD_NAME }}_ZIP path: ./out/make/zip/linux/x64/*.zip - # build-linux-arm64: - # runs-on: [ubuntu-latest, arm64] - # 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//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_NAME=inav-configurator_linux_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV - # - uses: actions/setup-node@v4 - # with: - # node-version: 20 - # check-latest: true - # cache: 'npm' - # - 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@v3 - # with: - # max_attempts: 3 - # retry_on: error - # command: npm install - # timeout_minutes: 10 - # - name: Build Linux - # run: npm run make - # - name: Upload Linux deb - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ env.BUILD_NAME }}_ARM64_DEB - # path: ./out/make/deb/*/*.deb - # - name: Upload Linux rpm - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ env.BUILD_NAME }}_ARM64_RPM - # path: ./out/make/rpm/x64/*.rpm - # - name: Upload Linux zip - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ env.BUILD_NAME }}_ARM64_ZIP - # path: ./out/make/zip/linux/*/*.zip + build-linux-arm64: + runs-on: [ubuntu-latest, arm64] + 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//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_NAMEarm64=inav-configurator_linux_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV + - uses: actions/setup-node@v4 + with: + node-version: 20 + check-latest: true + cache: 'npm' + - 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@v3 + with: + max_attempts: 3 + retry_on: error + command: npm install + timeout_minutes: 10 + - name: Build Linux + run: npm run make + - name: Upload Linux deb + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAMEarm64 }}_DEB + path: ./out/make/deb/*/*.deb + - name: Upload Linux rpm + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAMEarm64 }}_ARM64_RPM + path: ./out/make/rpm/x64/*.rpm + - name: Upload Linux zip + uses: actions/upload-artifact@v4 + with: + name: ${{ env.BUILD_NAME }}_ARM64_ZIP + path: ./out/make/zip/linux/*/*.zip build-mac-arm64: From d85578933d6ab6d72c280bab2bb6c4acbc0bd661 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:13:05 +0200 Subject: [PATCH 4/5] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49d97ff55..6d3ca8e5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: build-mac-arm64: - runs-on: macos-13 + runs-on: [macos-latest, arm64] steps: - uses: actions/checkout@v4 - name: Setup environment @@ -170,7 +170,7 @@ jobs: path: ./out/make/*arm64*.dmg build-mac: - runs-on: macos-13 + runs-on: [macos-latest, x64] steps: - uses: actions/checkout@v4 - name: Setup environment From 3570bfbfbe826980ce045950430a555ad0005544 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:15:00 +0200 Subject: [PATCH 5/5] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d3ca8e5e..699f61b26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: build-mac-arm64: - runs-on: [macos-latest, arm64] + runs-on: [macos-latest] steps: - uses: actions/checkout@v4 - name: Setup environment @@ -170,7 +170,7 @@ jobs: path: ./out/make/*arm64*.dmg build-mac: - runs-on: [macos-latest, x64] + runs-on: [macos-latest] steps: - uses: actions/checkout@v4 - name: Setup environment