-
-
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.
chore: 4k update from rep + workflow update
- Loading branch information
Sascha R
committed
Nov 7, 2024
1 parent
1ebf70e
commit 3a17bb6
Showing
4 changed files
with
260 additions
and
66 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,78 +5,128 @@ on: | |
- "v*-rc*" | ||
|
||
jobs: | ||
create_github_release: | ||
name: Create GitHub release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
id: ${{ steps.create_release.outputs.id }} | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: true | ||
|
||
build_a32nx: | ||
name: Build and publish A32NX | ||
# Prevent running this on forks | ||
if: github.repository_owner == 'flybywiresim' | ||
needs: create_github_release | ||
runs-on: ubuntu-latest | ||
env: | ||
FBW_PRODUCTION_BUILD: 1 | ||
RELEASE_ZIP_NAME: A32NX-stable.7z | ||
BUILD_DIR_NAME: stable | ||
STANDALONE_ZIP_NAME: A32NX-stable-rc.7z | ||
BUILD_DIR_NAME: stable-rc-a32nx | ||
AIRCRAFT_PROJECT_PREFIX: a32nx | ||
AIRCRAFT_VARIANT: a320-251n | ||
steps: | ||
- name: Maximize build space | ||
uses: AdityaGarg8/[email protected] | ||
with: | ||
remove-android: 'true' | ||
remove-dotnet: 'true' | ||
remove-haskell: 'true' | ||
remove-codeql: 'true' | ||
remove-large-packages: 'true' | ||
remove-cached-tools: 'true' | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
token: ${{ secrets.LARGE_FILES_TEMPORARY_PAT }} | ||
- 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-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 AIRCRAFT_PROJECT_PREFIX=${{ env.AIRCRAFT_PROJECT_PREFIX }} >> fbw-a32nx/.env | ||
echo AIRCRAFT_VARIANT=${{ env.AIRCRAFT_VARIANT }} >> 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 | ||
- name: Remove A380X source files | ||
run: | | ||
rm -rf ./fbw-a380x/ | ||
rm -rf ./large-files/fbw-a380x/ | ||
- name: Build ZIP file | ||
- name: Build Fragmenter modules | ||
run: | | ||
cd ./fbw-a32nx/out/ | ||
7z a -t7z -m0=lzma2 -mx=7 ../../${{ env.BUILD_DIR_NAME }}/${{ env.RELEASE_ZIP_NAME }} ./flybywire-aircraft-a320-neo/ | ||
cd ../.. | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
df -h | ||
node ./scripts/fragment_a32nx.js | ||
cp ./fbw-a32nx/out/build-modules/modules.json ./fbw-a32nx/out/flybywire-aircraft-a320-neo/install.json | ||
node ./scripts/install-source_a32nx.js | ||
df -h | ||
- name: Upload to CloudFlare CDN (Installer) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: true | ||
- name: Upload release asset | ||
uses: actions/[email protected] | ||
CLOUDFLARE_BUCKET_PASSWORD: ${{ secrets.CLOUDFLARE_BUCKET_PASSWORD }} | ||
CDN_BUCKET_DESTINATION: addons/a32nx/stable-rc | ||
run: | | ||
./scripts/cf-cdn.sh $CDN_BUCKET_DESTINATION ./fbw-a32nx/out/build-modules | ||
- name: Build Standalone Download files | ||
run: | | ||
mkdir ./${{ env.BUILD_DIR_NAME }} | ||
cd ./fbw-a32nx/out/ | ||
rm -rf build-modules | ||
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a320-neo/ | ||
cd ../../ | ||
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 1 ]; then | ||
mv ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }}.001 ./${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} # Only applicable if split in 1 part! | ||
fi | ||
df -h | ||
- name: Count Standalone Download files | ||
run: | | ||
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 1 ]; then | ||
echo "Standalone Download is is not split" | ||
else | ||
ls -1 ./${{ env.BUILD_DIR_NAME }}| wc -l | ||
echo "Error: The number of standalone download parts is not 1. Adjust all download references and workflows for the new number of parts!" >&2 | ||
exit 1 | ||
fi | ||
- name: Upload release assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.RELEASE_ZIP_NAME }} | ||
asset_name: ${{ env.RELEASE_ZIP_NAME }} | ||
asset_content_type: application/zip | ||
release_id: ${{ needs.create_github_release.outputs.id }} | ||
assets_path: ./${{ env.BUILD_DIR_NAME }}/ | ||
|
||
build_a380x_8k: | ||
name: Build and deploy A380X (8K) | ||
# Prevent running this on forks | ||
if: github.repository_owner == 'flybywiresim' | ||
needs: create_github_release | ||
runs-on: ubuntu-latest | ||
env: | ||
FBW_PRODUCTION_BUILD: 1 | ||
BUILD_DIR_NAME: stable-a380x | ||
BUILD_DIR_NAME: stable-rc-a380x | ||
AIRCRAFT_PROJECT_PREFIX: a380x | ||
STANDALONE_ZIP_NAME: A380X-stable-8K.7z | ||
STANDALONE_ZIP_NAME: A380X-stable-rc-8K.7z | ||
AIRCRAFT_VARIANT: a380-842 | ||
steps: | ||
- name: Maximize build space | ||
|
@@ -113,7 +163,6 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
token: ${{ secrets.LARGE_FILES_TEMPORARY_PAT }} | ||
- name: Set BUILT_DATE_TIME | ||
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV | ||
- name: Create .env file | ||
|
@@ -153,28 +202,47 @@ jobs: | |
- name: Upload to CloudFlare CDN (Installer) | ||
env: | ||
CLOUDFLARE_BUCKET_PASSWORD: ${{ secrets.CLOUDFLARE_BUCKET_PASSWORD }} | ||
CDN_BUCKET_DESTINATION: addons/a380x/rc-8k | ||
CDN_BUCKET_DESTINATION: addons/a380x/stable-rc-8k | ||
run: | | ||
./scripts/cf-cdn.sh $CDN_BUCKET_DESTINATION ./fbw-a380x/out/build-modules | ||
- name: Build Standalone Download files | ||
run: | | ||
mkdir ./${{ env.BUILD_DIR_NAME }} | ||
cd ./fbw-a380x/out/ | ||
rm -rf build-modules | ||
7z a -t7z -m0=lzma2 -mx=7 -v2g ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/ | ||
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/ | ||
cd ../../ | ||
df -h | ||
- name: Count Standalone Download files | ||
run: | | ||
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 3 ]; then | ||
echo "Standalone Download is split in 3 parts" | ||
else | ||
ls -1 ./${{ env.BUILD_DIR_NAME }}| wc -l | ||
echo "Error: The number of standalone download parts is not 3. Adjust all download references and workflows for the new number of parts!" >&2 | ||
exit 1 | ||
fi | ||
- name: Upload release assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
release_id: ${{ needs.create_github_release.outputs.id }} | ||
assets_path: ./${{ env.BUILD_DIR_NAME }}/ | ||
|
||
build_a380x_4k: | ||
name: Build and deploy A380X (4K) | ||
# Prevent running this on forks | ||
if: github.repository_owner == 'flybywiresim' | ||
needs: create_github_release | ||
runs-on: ubuntu-latest | ||
env: | ||
FBW_PRODUCTION_BUILD: 1 | ||
PRE_RELEASE_TAG: assets/stable | ||
PRE_RELEASE_ID: 66067814 | ||
BUILD_DIR_NAME: stable-a380x | ||
AIRCRAFT_PROJECT_PREFIX: a380x | ||
STANDALONE_ZIP_NAME: A380X-stable-4K.7z | ||
STANDALONE_ZIP_NAME: A380X-stable-rc-4K.7z | ||
AIRCRAFT_VARIANT: a380-842 | ||
steps: | ||
- name: Maximize build space | ||
|
@@ -211,7 +279,6 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
token: ${{ secrets.LARGE_FILES_TEMPORARY_PAT }} | ||
- name: Set BUILT_DATE_TIME | ||
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV | ||
- name: Create .env file | ||
|
@@ -248,14 +315,30 @@ jobs: | |
- name: Upload to CloudFlare CDN (Installer) | ||
env: | ||
CLOUDFLARE_BUCKET_PASSWORD: ${{ secrets.CLOUDFLARE_BUCKET_PASSWORD }} | ||
CDN_BUCKET_DESTINATION: addons/a380x/rc-4k | ||
CDN_BUCKET_DESTINATION: addons/a380x/stable-rc-4k | ||
run: | | ||
./scripts/cf-cdn.sh $CDN_BUCKET_DESTINATION ./fbw-a380x/out/build-modules | ||
- name: Build Standalone Download files | ||
run: | | ||
mkdir ./${{ env.BUILD_DIR_NAME }} | ||
cd ./fbw-a380x/out/ | ||
rm -rf build-modules | ||
7z a -t7z -m0=lzma2 -mx=7 -v2g ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/ | ||
7z a -t7z -m0=lzma2 -mx=7 -v2047m ../../${{ env.BUILD_DIR_NAME }}/${{ env.STANDALONE_ZIP_NAME }} ./flybywire-aircraft-a380-842/ | ||
cd ../../ | ||
df -h | ||
- name: Count Standalone Download files | ||
run: | | ||
if [ "$(ls -1 ./${{ env.BUILD_DIR_NAME }} | wc -l)" -eq 2 ]; then | ||
echo "Standalone Download is split in 2 parts" | ||
else | ||
ls -1 ./${{ env.BUILD_DIR_NAME }}| wc -l | ||
echo "Error: The number of standalone download parts is not 2. Adjust all download references and workflows for the new number of parts!" >&2 | ||
exit 1 | ||
fi | ||
- name: Upload release assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
release_id: ${{ needs.create_github_release.outputs.id }} | ||
assets_path: ./${{ env.BUILD_DIR_NAME }}/ |
Oops, something went wrong.