Enable 10 channels for pwm_esc #1275
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: tiiuae-pixhawk-and-saluki | |
on: | |
push: | |
branches: [ main, rel9_hotfix ] | |
pull_request: | |
branches: [ main, rel9_hotfix ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
pixhawk: | |
name: build pixhawk | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware pixhawk build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./clone_public.sh | |
./build.sh ../bin/ pixhawk | |
ls ../bin | |
- name: Upload pixhawk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
# NOTE: private repo is needed for this build, which is not available for forked PRs | |
saluki-v1_default: | |
name: build saluki-v1_default | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v1_default build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v1_default | |
ls ../bin | |
- name: Upload saluki-v1_default | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v1_bootloader: | |
name: build saluki-v1_bootloader | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v1_bootloader build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v1_bootloader | |
ls ../bin | |
- name: Upload saluki-v1_bootloader | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v1_amp: | |
name: build saluki-v1_amp | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v1_amp build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v1_amp | |
ls ../bin | |
- name: Upload saluki-v1_amp | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v1_protected: | |
name: build saluki-v1_protected | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v1_protected build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v1_protected | |
ls ../bin | |
- name: Upload saluki-v1_protected | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v2_default: | |
name: build saluki-v2_default | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v2_default build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v2_default | |
ls ../bin | |
- name: Upload saluki-v2_default | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v2_bootloader: | |
name: build saluki-v2_bootloader | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v2_bootloader build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v2_bootloader | |
ls ../bin | |
- name: Upload saluki-v2_bootloader | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
saluki-v2_amp: | |
name: build saluki-v2_amp | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
submodules: recursive | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Run px4-firmware saluki-v2_amp build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./build.sh ../bin/ saluki-v2_amp | |
ls ../bin | |
- name: Upload saluki-v2_amp | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
px4fwupdater: | |
name: build px4fwupdater | |
runs-on: ubuntu-latest | |
needs: | |
- pixhawk | |
- saluki-v1_default | |
- saluki-v1_bootloader | |
- saluki-v1_amp | |
- saluki-v1_protected | |
- saluki-v2_default | |
- saluki-v2_bootloader | |
- saluki-v2_amp | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Download pixhawk artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin | |
- name: Run px4-firmware px4fwupdater build | |
run: | | |
set -eux | |
mkdir -p bin | |
cd px4-firmware/ | |
./clone_public.sh | |
./build.sh ../bin/ px4fwupdater | |
ls ../bin | |
- name: Upload px4fwupdater to tmp storage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin/ | |
retention-days: 1 | |
upload-px4fwupdater: | |
name: upload px4fwupdater to docker registry | |
runs-on: ubuntu-latest | |
needs: | |
- px4fwupdater | |
if: true | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Download pixhawk artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin | |
- name: Firmware flasher - Container metadata | |
id: containermeta # referenced from later step | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/tiiuae/px4-firmware | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=sha | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Firmware flasher - Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
file: px4-firmware/Tools/px_uploader.Dockerfile | |
tags: ${{ steps.containermeta.outputs.tags }} | |
labels: ${{ steps.containermeta.outputs.labels }} | |
upload-px4fwupdater-uae: | |
name: upload px4fwupdater to UAE docker registry | |
runs-on: ubuntu-latest | |
needs: | |
- px4fwupdater | |
steps: | |
- name: Checkout px4-firmware | |
uses: actions/checkout@v3 | |
with: | |
path: px4-firmware | |
fetch-depth: 0 | |
- name: Download pixhawk artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin | |
- name: Firmware flasher - Container metadata | |
id: containermeta # referenced from later step | |
uses: docker/metadata-action@v4 | |
with: | |
images: artifactory.ssrcdevops.tii.ae/tiiuae/px4-firmware | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=sha | |
- name: Login to SSRC JFrog Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: artifactory.ssrcdevops.tii.ae | |
username: ${{ secrets.UAE_RT_USER }} | |
password: ${{ secrets.UAE_RT_APIKEY }} | |
- name: Firmware flasher - Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
context: . | |
file: px4-firmware/Tools/px_uploader.Dockerfile | |
tags: ${{ steps.containermeta.outputs.tags }} | |
labels: ${{ steps.containermeta.outputs.labels }} | |
artifactory: | |
name: upload builds to artifactory | |
runs-on: ubuntu-latest | |
needs: | |
- pixhawk | |
- saluki-v1_default | |
- saluki-v1_bootloader | |
- saluki-v1_amp | |
- saluki-v1_protected | |
- saluki-v2_default | |
- saluki-v2_bootloader | |
- saluki-v2_amp | |
- px4fwupdater | |
if: true | |
steps: | |
- name: Download pixhawk artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin | |
- uses: jfrog/setup-jfrog-cli@v3 | |
env: | |
JF_ENV_1: ${{ secrets.ARTIFACTORY_CLOUD_TOKEN }} | |
- name: Upload px4-firmware build to Artifactory | |
env: | |
ARTIFACTORY_GEN_REPO: ssrc-gen-public-local | |
BUILD_NAME_PX4: px4-firmware | |
CI: true | |
run: | | |
set -exu | |
pr_or_empty="" | |
if [ ${{ github.event_name }} == 'pull_request' ]; then | |
pr_or_empty="pr/" | |
fi | |
for pkg in $(find bin -type f); do | |
file_name=$(basename $pkg) | |
ext="${file_name##*.}" | |
target_path="" | |
pkg_name=$(echo $file_name | sed -r -e 's/-[0-9]+\.[0-9]+\.[0-9]+-.*//g') | |
if [[ $file_name = px4_fmu* ]]; then | |
target_path="pixhawk" | |
elif [[ $file_name = ssrc_saluki* ]]; then | |
target_path="saluki" | |
else | |
echo "$pkg ignored" | |
continue | |
fi | |
jfrog rt u --target-props COMMIT="$GITHUB_SHA" \ | |
--build-name "$BUILD_NAME_PX4" \ | |
--build-number "$GITHUB_SHA" \ | |
"$pkg" \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}$file_name" | |
jfrog rt cp --flat \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}$file_name" \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}latest/${pkg_name}.${ext}" | |
done | |
jfrog rt build-publish "$BUILD_NAME_PX4" "$GITHUB_SHA" | |
jfrog rt bpr "$BUILD_NAME_PX4" "$GITHUB_SHA" "$ARTIFACTORY_GEN_REPO" \ | |
--status dev \ | |
--comment "development build" | |
artifactory-uae: | |
name: upload builds to UAE artifactory | |
runs-on: ubuntu-latest | |
needs: | |
- pixhawk | |
- saluki-v1_default | |
- saluki-v1_bootloader | |
- saluki-v1_amp | |
- saluki-v1_protected | |
- saluki-v2_default | |
- saluki-v2_bootloader | |
- saluki-v2_amp | |
- px4fwupdater | |
if: true | |
steps: | |
- name: Download pixhawk artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: pixhawk | |
path: bin | |
- uses: jfrog/setup-jfrog-cli@v3 | |
env: | |
JF_ENV_1: ${{ secrets.UAE_ARTIFACTORY_TOKEN }} | |
- name: Upload px4-firmware build to Artifactory | |
env: | |
ARTIFACTORY_GEN_REPO: gen-public-local | |
BUILD_NAME_PX4: px4-firmware | |
CI: true | |
run: | | |
set -exu | |
pr_or_empty="" | |
if [ ${{ github.event_name }} == 'pull_request' ]; then | |
pr_or_empty="pr/" | |
fi | |
for pkg in $(find bin -type f); do | |
file_name=$(basename $pkg) | |
ext="${file_name##*.}" | |
target_path="" | |
pkg_name=$(echo $file_name | sed -r -e 's/-[0-9]+\.[0-9]+\.[0-9]+-.*//g') | |
if [[ $file_name = px4_fmu* ]]; then | |
target_path="pixhawk" | |
elif [[ $file_name = ssrc_saluki* ]]; then | |
target_path="saluki" | |
else | |
echo "$pkg ignored" | |
continue | |
fi | |
jfrog rt u --target-props COMMIT="$GITHUB_SHA" \ | |
--build-name "$BUILD_NAME_PX4" \ | |
--build-number "$GITHUB_SHA" \ | |
"$pkg" \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}$file_name" | |
jfrog rt cp --flat \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}$file_name" \ | |
"$ARTIFACTORY_GEN_REPO/builds/px4-firmware/${target_path}/${pr_or_empty}latest/${pkg_name}.${ext}" | |
done | |
jfrog rt build-publish "$BUILD_NAME_PX4" "$GITHUB_SHA" | |
jfrog rt bpr "$BUILD_NAME_PX4" "$GITHUB_SHA" "$ARTIFACTORY_GEN_REPO" \ | |
--status dev \ | |
--comment "development build" | |
- name: Upload px4-fwupdater build to Artifactory | |
env: | |
ARTIFACTORY_DEB_REPO: debian-public-local | |
DISTRIBUTION: focal | |
COMPONENT: fog-sw | |
ARCHITECTURE: amd64 | |
BUILD_NAME_DEB: px4-fwupdater | |
CI: true | |
run: | | |
set -exu | |
pkg=$(find bin -name 'px4fwupdater*.deb') | |
pkg_name=$(basename $pkg) | |
jfrog rt u --deb "$DISTRIBUTION/$COMPONENT/$ARCHITECTURE" \ | |
--target-props COMMIT="$GITHUB_SHA" \ | |
--build-name "$BUILD_NAME_DEB" \ | |
--build-number "$GITHUB_SHA" \ | |
"$pkg" \ | |
"$ARTIFACTORY_DEB_REPO/$pkg_name" | |
jfrog rt build-publish "$BUILD_NAME_DEB" "$GITHUB_SHA" | |
jfrog rt bpr "$BUILD_NAME_DEB" "$GITHUB_SHA" "$ARTIFACTORY_DEB_REPO" \ | |
--status dev \ | |
--comment "development build" |