-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add A380X build actions (#8390)
- Loading branch information
Showing
26 changed files
with
240 additions
and
136 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,50 @@ | ||
# Build script for the A32NX on master branch | ||
# Build independent of the A380X to avoid side effects if one or the other fails | ||
|
||
# TODO: Add a check if something changed outside of the fbw-a380x folder (which isn't of interest for this build) | ||
# Consider that master pre release should always have a A32NX and A380x though | ||
|
||
name: master | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
build_a32nx: | ||
name: Build and deploy A32NX | ||
# Prevent running this on forks | ||
if: github.repository_owner == 'flybywiresim' | ||
runs-on: ubuntu-latest | ||
env: | ||
A32NX_PRODUCTION_BUILD: 1 | ||
FBW_PRODUCTION_BUILD: 1 | ||
A32NX_INSTRUMENTS_BUILD_WORKERS: 2 | ||
MASTER_PRE_RELEASE_ID: 66067756 | ||
MASTER_PRE_RELEASE_TAG: assets/master | ||
MASTER_ZIP_NAME: A32NX-master.7z | ||
VMASTER_PRE_RELEASE_ID: 32243965 | ||
VMASTER_PRE_RELEASE_TAG: vmaster | ||
BUILD_DIR_NAME: master | ||
BUILD_DIR_NAME: master-a32nx | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- name: Set BUILT_DATE_TIME | ||
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV | ||
- name: Create .env file | ||
run: | | ||
echo A32NX_PRODUCTION_BUILD=1 >> fbw-a32nx/.env | ||
echo FBW_PRODUCTION_BUILD=1 >> fbw-a32nx/.env | ||
echo CLIENT_ID=\"${{ secrets.NAVIGRAPH_CLIENT_ID }}\" >> fbw-a32nx/.env | ||
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET }}\" >> fbw-a32nx/.env | ||
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env | ||
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env | ||
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env | ||
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env | ||
echo VITE_BUILD=false >> .env | ||
- name: Build A32NX | ||
- name: Install dependencies | ||
run: | | ||
./scripts/dev-env/run.sh ./scripts/setup.sh --clean | ||
- name: Build A32NX | ||
run: | | ||
./scripts/dev-env/run.sh ./scripts/build_a32nx.sh --no-tty -j 4 | ||
rm -rf fbw-a32nx/src | ||
docker system prune -af | ||
|
@@ -60,7 +69,92 @@ jobs: | |
with: | ||
token: ${{ github.token }} | ||
tag: ${{ env.MASTER_PRE_RELEASE_TAG }} | ||
assets: "*" | ||
assets: "${{ env.MASTER_ZIP_NAME }}" | ||
fail-if-no-assets: false | ||
- name: Upload aircraft package to GitHub Pre-Release Assets | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.MASTER_PRE_RELEASE_ID }}/assets{?name,label} | ||
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.MASTER_ZIP_NAME }} | ||
asset_name: ${{ env.MASTER_ZIP_NAME }} | ||
asset_content_type: application/zip | ||
- name: Upload fragments to GitHub Pre-Release Assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
release_id: ${{ env.MASTER_PRE_RELEASE_ID }} | ||
assets_path: ./fbw-a32nx/out/build-modules | ||
- name: Update GitHub Pre-Release Body | ||
run: | | ||
curl --request PATCH \ | ||
--url 'https://api.github.com/repos/${{ github.repository }}/releases/${{ env.MASTER_PRE_RELEASE_ID }}' \ | ||
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{ | ||
"body": "This pre-release has its asset updated on every commit to the master branch\nLast updated on ${{ env.BUILT_DATE_TIME }} from commit ${{ github.sha }}\nThis link will always point to the latest master build: https://github.com/${{ github.repository }}/releases/download/${{ env.MASTER_PRE_RELEASE_TAG }}/${{ env.MASTER_ZIP_NAME }}" | ||
}' | ||
build_a380x: | ||
name: Build and deploy A380X | ||
# Prevent running this on forks | ||
if: github.repository_owner == 'flybywiresim' | ||
runs-on: ubuntu-latest | ||
env: | ||
FBW_PRODUCTION_BUILD: 1 | ||
MASTER_PRE_RELEASE_ID: 66067756 | ||
MASTER_PRE_RELEASE_TAG: assets/master | ||
MASTER_ZIP_NAME: A380X-master.7z | ||
VMASTER_PRE_RELEASE_ID: 32243965 | ||
VMASTER_PRE_RELEASE_TAG: vmaster | ||
BUILD_DIR_NAME: master-a380x | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
- name: Set BUILT_DATE_TIME | ||
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV | ||
- name: Create .env file | ||
run: | | ||
echo FBW_PRODUCTION_BUILD=1 >> fbw-a380x/.env | ||
echo CLIENT_ID=\"${{ secrets.NAVIGRAPH_CLIENT_ID_A380X }}\" >> fbw-a380x/.env | ||
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET_A380X }}\" >> fbw-a380x/.env | ||
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a380x/.env | ||
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a380x/.env | ||
echo BUILD_DIR_NAME=${{ env.BUILD_DIR_NAME }} >> .env | ||
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env | ||
echo VITE_BUILD=false >> .env | ||
- name: Install dependencies | ||
run: | | ||
./scripts/dev-env/run.sh ./scripts/setup.sh --clean | ||
- name: Build A380X | ||
run: | | ||
./scripts/dev-env/run.sh ./scripts/build_a380x.sh --no-tty -j 4 | ||
rm -rf fbw-a380x/src | ||
docker system prune -af | ||
- name: Build ZIP files | ||
run: | | ||
df -h | ||
node ./scripts/fragment_a380x.js | ||
cp ./fbw-a380x/out/build-modules/modules.json ./fbw-a380x/out/flybywire-aircraft-a380-842/install.json | ||
node ./scripts/install-source_a380x.js | ||
mkdir ./${{ env.BUILD_DIR_NAME }} | ||
cd ./fbw-a380x/out/ | ||
7z a -t7z -m0=lzma2 -mx=7 ../../${{ env.BUILD_DIR_NAME }}/${{ env.MASTER_ZIP_NAME }} ./flybywire-aircraft-a380-842/ | ||
cd ../../ | ||
- name: Upload to CloudFlare CDN | ||
env: | ||
CLOUDFLARE_BUCKET_PASSWORD: ${{ secrets.CLOUDFLARE_BUCKET_PASSWORD }} | ||
CDN_BUCKET_DESTINATION: addons/a380x/master | ||
run: | | ||
./scripts/cf-cdn.sh $CDN_BUCKET_DESTINATION ./fbw-a380x/out/build-modules | ||
- name: Delete old GitHub Pre-Release assets | ||
uses: mknejp/delete-release-assets@v1 | ||
with: | ||
token: ${{ github.token }} | ||
tag: ${{ env.MASTER_PRE_RELEASE_TAG }} | ||
assets: "${{ env.MASTER_ZIP_NAME }}" | ||
fail-if-no-assets: false | ||
- name: Upload aircraft package to GitHub Pre-Release Assets | ||
uses: actions/[email protected] | ||
|
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
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
Oops, something went wrong.