Skip to content

Train and Release

Train and Release #9

name: Train and Release
on:
workflow_dispatch:
inputs:
generations:
description: 'Number of generations'
required: true
default: '10'
type: string
jobs:
train-and-visualize:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup and Train
run: |
make all
./orchestrate.out ${{ github.event.inputs.generations }}
WEIGHTS_FILE=$(ls -t *_policy.bin | head -n1)
./visualize.out $WEIGHTS_FILE
GIF_FILE=$(ls -t *_flight.gif | head -n1)
echo "WEIGHTS_FILE=${WEIGHTS_FILE}" >> $GITHUB_ENV
echo "GIF_FILE=${GIF_FILE}" >> $GITHUB_ENV
echo "TIMESTAMP=$(date +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: run-${{ github.run_number }}
name: "🚁 Quadcopter Training #${{ github.run_number }}"
body: |
## ✨ Training Details
- 🔄 Generations: ${{ github.event.inputs.generations }}
- ⏰ Completed: ${{ env.TIMESTAMP }}
files: |
${{ env.WEIGHTS_FILE }}
${{ env.GIF_FILE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}