feat: rerequest autopilot info #276
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: Linux Release | |
on: | |
push: | |
branches: | |
- 'aviant/*' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
defaults: | |
run: | |
shell: bash | |
env: | |
SOURCE_DIR: ${{ github.workspace }} | |
QT_VERSION: 5.15.2 | |
ARTIFACT: QGroundControl.AppImage | |
BUILD_TYPE: ${{ fromJSON('["DailyBuild", "StableBuild"]')[ github.ref_type == 'tag' || github.ref == 'aviant/V4.2' ] }} | |
ECR_REGISTRY: ${{ vars.ECR_REGISTRY }} | |
ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Get all tags for correct version determination | |
working-directory: ${{ github.workspace }} | |
run: | | |
git fetch --all --tags -f | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ env.QT_VERSION }} | |
host: linux | |
target: desktop | |
dir: ${{ runner.temp }} | |
modules: qtcharts | |
setup-python: true | |
- name: Install QGC source dependencies | |
run: sudo apt-get install -y libsdl2-dev | |
- name: Install Gstreamer | |
run: sudo apt-get install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-0:amd64 libgstreamer1.0-dev | |
- name: Install post-link dependencies | |
run: sudo apt-get install -y binutils patchelf | |
- name: Create build directory | |
run: mkdir ${{ runner.temp }}/shadow_build_dir | |
- name: Build | |
working-directory: ${{ runner.temp }}/shadow_build_dir | |
run: | | |
qmake -r ${SOURCE_DIR}/qgroundcontrol.pro CONFIG+=installer CONFIG+=${BUILD_TYPE} | |
make -j2 | |
- name: Create AppImage | |
working-directory: ${{ runner.temp }}/shadow_build_dir | |
run: ${SOURCE_DIR}/deploy/create_linux_appimage.sh ${SOURCE_DIR} ./staging ./package; | |
- name: Save artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} | |
retention-days: 1 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 # ECR Public can only be logged into from the us-east-1 region. | |
- name: Login to AWS ECR | |
id: login-ecr-public | |
uses: aws-actions/amazon-ecr-login@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
registry-type: public | |
- name: Build docker image | |
working-directory: ${{ runner.temp }}/shadow_build_dir | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker build --build-arg="APPIMAGE_PATH=${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }}" / -f ${SOURCE_DIR}/.github/docker/Dockerfile -t ${ECR_REGISTRY}/${ECR_REPOSITORY}:${{ github.ref_name }} | |
- name: Push docker image to AWS ECR | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
prerelease: true | |
files: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} |