forked from flybywiresim/aircraft
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (60 loc) · 2.28 KB
/
pre-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Pre release
on:
push:
tags:
- "v*-rc*"
jobs:
build_a32nx:
name: Build and publish A32NX
runs-on: ubuntu-latest
env:
FBW_PRODUCTION_BUILD: 1
RELEASE_ZIP_NAME: A32NX-stable.7z
BUILD_DIR_NAME: stable
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v2
- 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 LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
./scripts/dev-env/run.sh ./scripts/build.sh --no-tty -j 4
rm -rf fbw-a32nx/src
docker system prune -af
- name: Build ZIP file
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
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/upload-release-asset@v1.0.2
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