Skip to content

Commit

Permalink
update workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
Revyn112 committed May 10, 2023
1 parent 45ca51d commit 36233bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
EXP_PRE_RELEASE_ID: 79990124
EXP_PRE_RELEASE_TAG: vexp
EXP_ZIP_NAME: headwind-aircraft-a330-900-experimental.zip
BUILD_DIR_NAME: vexp
BUILD_DIR_NAME: experimental
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
MAIN_PRE_RELEASE_ID: 64726828
MAIN_PRE_RELEASE_TAG: vmain
MAIN_ZIP_NAME: headwind-aircraft-a330-900-main.zip
BUILD_DIR_NAME: vmain
BUILD_DIR_NAME: main
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand Down
39 changes: 12 additions & 27 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ jobs:
env:
A32NX_PRODUCTION_BUILD: 1
A32NX_INSTRUMENTS_BUILD_WORKERS: 2
PRE_RELEASE_ID: 102436135
PRE_RELEASE_TAG: vstaging
ZIP_NAME: headwind-aircraft-a330-900-staging.zip
BUILD_DIR_NAME: vstaging
BUILD_DIR_NAME: staging
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand Down Expand Up @@ -47,35 +45,22 @@ jobs:
cd ./build-a339x/out/
zip -r ../../${{ env.BUILD_DIR_NAME }}/${{ env.ZIP_NAME }} ./headwindsim-aircraft-a330-900/
cd ../../
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ github.token }}
tag: ${{ env.PRE_RELEASE_TAG }}
assets: "*"
fail-if-no-assets: false
- name: Upload zip asset to Release
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
- name: Upload release asset
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}
upload_url: ${{ steps.create_release.outputs.upload_url }}
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
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_id: ${{ env.PRE_RELEASE_ID }}
assets_path: ./build-a339x/out/build-modules/
- name: Update 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 cadidate 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.PRE_RELEASE_TAG }}/${{ env.ZIP_NAME }}"
}'
2 changes: 1 addition & 1 deletion scripts/build_a339x.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const edition = require('../package.json').edition;
let titlePostfix;
if (edition === 'stable') {
titlePostfix = 'Stable';
} else if (GIT_BRANCH === 'master') {
} else if (GIT_BRANCH === 'main') {
titlePostfix = 'Development';
} else if (GIT_BRANCH === 'experimental') {
titlePostfix = 'Experimental';
Expand Down

0 comments on commit 36233bc

Please sign in to comment.