Github Actions

- Added workflow to build demo mission on-the-fly
- Added python script to replace Moose.lua in all miz files
This commit is contained in:
Frank
2022-10-11 21:16:23 +02:00
parent d1c852d7ee
commit 33f4e46a8d
3 changed files with 206 additions and 6 deletions

91
.github/workflows/UpdateMoose.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
# This workflow updates the Moose.lua file in all miz files.
name: Build Demo Missions
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events for the "main" and "develop" branches
push:
branches:
- master
- develop
# Triggers the workflow on pull request events for the "main" and "develop" branches
pull_request:
branches:
- master
- develop
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "Update"
Update:
# Operating system
runs-on: ubuntu-latest
# Set environment variable (not used)
env:
BRANCH: main
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Say Mission branch name
- name: Mission branch
run: echo ${GITHUB_REF_NAME}
# Check if master
- name: Check if master
if: ${{ github.ref_name=='master' }}
run: echo "MOOSE_BRANCH=master" >> $GITHUB_ENV
# Check if develop
- name: Check if develop
if: ${{ github.ref_name=='develop' }}
run: echo "MOOSE_BRANCH=develop" >> $GITHUB_ENV
# Say Moose branch name.
- name: Moose branch name
run: echo $MOOSE_BRANCH
# Checks-out MOOSE_INCLUDE to ./MooseFiles
- name: Checkout MOOSE_INCLUDE
uses: actions/checkout@v3
with:
repository: FlightControl-Master/MOOSE_INCLUDE
ref: ${{ env.MOOSE_BRANCH }}
path: ./MooseFiles
# Checks-out repository to ./self
- name: Checkout Missions
uses: actions/checkout@v3
with:
#ref: ${{ env.BRANCH }}
path: ./self
# Install python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # install the python version needed
# Run python script to update Moose.lua in all miz files
- name: Run UpdateMoose.py
run: |
cd ./self
python .scripts/UpdateMoose.py ../MooseFiles/Moose_Include_Static/ ./
# Commit changes
- name: Commit Changes
run: |
cd ./self
git add *
git config --global user.name 'funkyfranky'
git config --global user.email 'frank@inter-zone.de'
git commit -am "Updated Moose.lua"
git push

View File

@@ -5,13 +5,13 @@ name: Build Demo Missions (packed)
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
schedule:
- cron: '0 7 * * 6'
#schedule:
# - cron: '0 7 * * 6'
push:
branches:
- master
- develop
#push:
# branches:
# - master
# - develop
workflow_dispatch:
inputs: