mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
95 lines
2.6 KiB
YAML
95 lines
2.6 KiB
YAML
# 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
|
|
|
|
# Cron job every day at 2 o'clock.
|
|
schedule:
|
|
- cron: '0 2 * * 0'
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
inputs:
|
|
name:
|
|
description: 'Manual Run'
|
|
required: false
|
|
default: 'The Octoverse'
|
|
|
|
# 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" || echo "No changes to commit"
|
|
git push
|