Skip to content

Commit

Permalink
chore: update workflows
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
Revyn112 committed Oct 11, 2023
1 parent 4e8425b commit 590518f
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 152 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: A339X Livery Package Main
name: A339X Livery Package Development
on:
push:
branches:
- main
paths:
- '.github/workflows/a339x-livery-package-main.yml'
- '.github/workflows/a339x-livery-package-dev.yml'
- 'hdw-a339x-liveries/**'
- 'scripts/build-a339x-liveries.js'
- 'scripts/build-a339x-liveries.sh'
Expand All @@ -21,8 +21,8 @@ jobs:
env:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
ZIP_NAME: hdw-a339x-liveries-main.zip
BUILD_DIR_NAME: main
ZIP_NAME: hdw-a339x-liveries-dev.zip
BUILD_DIR_NAME: dev
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand All @@ -70,6 +70,6 @@ jobs:
- name: Upload to CloudFlare CDN
env:
CLOUDFLARE_WORKER_PASSWORD: ${{ secrets.CLOUDFLARE_WORKER_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a339x-livery-package/main
CDN_BUCKET_DESTINATION: addons/a339x-livery-package/dev
run: |
./scripts/cdn.sh $CDN_BUCKET_DESTINATION ./hdw-a339x-liveries/out/build-modules
2 changes: 1 addition & 1 deletion .github/workflows/a339x-livery-package-exp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/a339x-livery-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/a339x-livery-package-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand Down
47 changes: 10 additions & 37 deletions .github/workflows/main.yml → .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: main
name: development
on:
push:
branches:
Expand All @@ -10,10 +10,8 @@ jobs:
env:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
PRE_RELEASE_ID: 64726828
PRE_RELEASE_TAG: vmain
ZIP_NAME: headwindsim-aircraft-a330-900-main.zip
BUILD_DIR_NAME: main
ZIP_NAME: headwindsim-aircraft-a330-900-dev.zip
BUILD_DIR_NAME: development
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand All @@ -26,7 +24,7 @@ jobs:
docker-images: false
swap-storage: false
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set BUILT_DATE_TIME
Expand All @@ -42,7 +40,7 @@ jobs:
echo VITE_BUILD=false >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand All @@ -58,35 +56,10 @@ jobs:
cd ./build-a339x/out/
zip -r ../../${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }} ./headwindsim-aircraft-a330-900/
cd ../../
- name: Delete old GitHub Pre-Release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ env.PRE_RELEASE_TAG }}
assets: "*"
fail-if-no-assets: false
- name: Upload aicraft 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.PRE_RELEASE_ID }}/assets{?name,label}
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }}
asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip
- name: Upload fragment assets to pre-release
uses: dwenegar/upload-release-assets@v1
- name: Upload to CloudFlare CDN
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ env.PRE_RELEASE_ID }}
assets_path: ./build-a339x/out/build-modules/
- name: Update GitHub Pre-Release Body
CLOUDFLARE_WORKER_PASSWORD: ${{ secrets.CLOUDFLARE_WORKER_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a339x/development
run: |
curl --request PATCH \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/${{ env.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 main branch\nLast updated on ${{ env.BUILT_DATE_TIME }} from commit ${{ github.sha }}\n"
}'
./scripts/cdn.sh $CDN_BUCKET_DESTINATION ./build-a339x/out/build-modules
38 changes: 5 additions & 33 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ jobs:
env:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
EXP_PRE_RELEASE_ID: 79990124
EXP_PRE_RELEASE_TAG: vexp
EXP_ZIP_NAME: headwindsim-aircraft-a330-900-experimental.zip
EXP_ZIP_NAME: headwindsim-aircraft-a330-900-exp.zip
BUILD_DIR_NAME: experimental
steps:
- name: Free Disk Space (Ubuntu)
Expand Down Expand Up @@ -58,35 +56,9 @@ jobs:
cd ./build-a339x/out/
zip -r ../../${{ env.BUILD_DIR_NAME }}/${{ env.EXP_ZIP_NAME }} ./headwindsim-aircraft-a330-900/
cd ../../
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ env.EXP_PRE_RELEASE_TAG }}
assets: "*"
fail-if-no-assets: false
- name: Upload main zip asset to vexp release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.EXP_PRE_RELEASE_ID }}/assets{?name,label}
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.EXP_ZIP_NAME }}
asset_name: ${{ env.EXP_ZIP_NAME }}
asset_content_type: application/zip
- name: Upload fragment assets to vexp release
uses: dwenegar/upload-release-assets@v1
- name: Upload to CloudFlare CDN
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ env.EXP_PRE_RELEASE_ID }}
assets_path: ./build-a339x/out/build-modules/
- name: Update vexp release body
CLOUDFLARE_WORKER_PASSWORD: ${{ secrets.CLOUDFLARE_WORKER_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a339x-livery-package/exp
run: |
curl --request PATCH \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/${{ env.EXP_PRE_RELEASE_ID }}' \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--data-raw '{
"body": "This release has its asset updated on every commit to the experimental branch\nLast updated on ${{ env.BUILT_DATE_TIME }} from commit ${{ github.sha }}\n"
}'
./scripts/cdn.sh $CDN_BUCKET_DESTINATION ./hdw-a339x-liveries/out/build-modules
47 changes: 10 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
env:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
PRE_RELEASE_ID: 64726773
PRE_RELEASE_TAG: vstable
ZIP_NAME: headwindsim-aircraft-a330-900-stable.zip
BUILD_DIR_NAME: stable
steps:
Expand All @@ -29,7 +27,7 @@ jobs:
docker-images: false
swap-storage: false
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Create .env file
Expand All @@ -43,7 +41,7 @@ jobs:
echo VITE_BUILD=false >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand All @@ -59,17 +57,23 @@ jobs:
cd ./build-a339x/out/
zip -r ../../${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }} ./headwindsim-aircraft-a330-900/
cd ../../
- name: Upload to CloudFlare CDN
env:
CLOUDFLARE_WORKER_PASSWORD: ${{ secrets.CLOUDFLARE_WORKER_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a339x/release
run: |
./scripts/cdn.sh $CDN_BUCKET_DESTINATION ./build-a339x/out/build-modules
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release asset
- name: Upload Release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -78,34 +82,3 @@ jobs:
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }}
asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip
- name: Delete old GitHub Pre-Release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ env.PRE_RELEASE_TAG }}
assets: "*"
- name: Upload aicraft 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.PRE_RELEASE_ID }}/assets{?name,label}
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }}
asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip
- name: Upload fragment assets to pre-release
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ env.PRE_RELEASE_ID }}
assets_path: ./build-a339x/out/build-modules/
- name: Update GitHub Pre-Release Body
run: |
curl --request PATCH \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/${{ env.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 release\nLast updated on ${{ env.BUILT_DATE_TIME }} from commit ${{ github.sha }}\nThis link will always point to the latest stable build: https://github.com/${{ github.repository }}/releases/download/${{ env.PRE_RELEASE_TAG }}/${{ env.ZIP_NAME }}"
}'
40 changes: 6 additions & 34 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
ZIP_NAME: headwindsim-aircraft-a330-900-staging.zip
RELEASE_ID: 103223112
RELEASE_TAG: vstaging
BUILD_DIR_NAME: staging
steps:
- name: Free Disk Space (Ubuntu)
Expand All @@ -27,7 +25,7 @@ jobs:
docker-images: false
swap-storage: false
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set BUILT_DATE_TIME
Expand All @@ -43,7 +41,7 @@ jobs:
echo VITE_BUILD=false >> .env
- name: Setup Package
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Copy Sources
run: |
./scripts/dev-env/run.sh ./scripts/copy_a339x.sh
Expand All @@ -59,38 +57,12 @@ jobs:
cd ./build-a339x/out/
zip -r ../../${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }} ./headwindsim-aircraft-a330-900/
cd ../../
- name: Delete old vstaging release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ env.RELEASE_TAG }}
assets: "*"
fail-if-no-assets: false
- name: Upload zip asset to staging release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets{?name,label}
asset_path: ./${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }}
asset_name: ${{ env.ZIP_NAME }}
asset_content_type: application/zip
- name: Upload fragment assets to Release
uses: dwenegar/upload-release-assets@v1
- name: Upload to CloudFlare CDN
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ env.RELEASE_ID }}
assets_path: ./build-a339x/out/build-modules/
- name: Update staging release body
CLOUDFLARE_WORKER_PASSWORD: ${{ secrets.CLOUDFLARE_WORKER_PASSWORD }}
CDN_BUCKET_DESTINATION: addons/a339x/staging
run: |
curl --request PATCH \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/${{ env.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 staging publish\nLast updated on ${{ env.BUILT_DATE_TIME }} from commit ${{ github.sha }}\nThis link will always point to the latest staging build: https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/${{ env.ZIP_NAME }}"
}'
./scripts/cdn.sh $CDN_BUCKET_DESTINATION ./build-a339x/out/build-modules
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
11 changes: 9 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ set -ex

git config --global --add safe.directory "*"

# initialize submodule (a32nx)
# initialize submodule
git submodule update --init --recursive

cd /external
rm -rf node_modules

for arg in "$@"; do
if [ "$arg" = "--clean" ]; then
echo "Removing node_modules..."
rm -rf node_modules/
fi
done

npm ci

0 comments on commit 590518f

Please sign in to comment.