Release/v0.1.0 #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
# First job to check if we should run the release | |
check_release: | |
runs-on: ubuntu-latest | |
if: | | |
github.event.pull_request.merged == true && | |
(contains(github.event.pull_request.head.ref, 'hotfix/v') || | |
contains(github.event.pull_request.head.ref, 'Hotfix/v') || | |
contains(github.event.pull_request.head.ref, 'release/v') || | |
contains(github.event.pull_request.head.ref, 'Release/v')) | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- name: Extract version from branch name | |
id: get_version | |
run: | | |
BRANCH=${{ github.event.pull_request.head.ref }} | |
VERSION=${BRANCH#*/v} # Remove prefix up to v | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
# Build job that runs on each OS | |
build: | |
needs: check_release | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
build_os: windows | |
artifact_name: Radio Telemetry Tracker Drone Ground Control Station.exe | |
release_name: RTT-GCS-windows-x64.exe | |
- os: ubuntu-latest | |
build_os: linux | |
artifact_name: Radio Telemetry Tracker Drone Ground Control Station | |
release_name: RTT-GCS-linux-x64 | |
- os: macos-latest | |
build_os: macos | |
artifact_name: Radio Telemetry Tracker Drone Ground Control Station | |
release_name: RTT-GCS-macos-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.13' | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Install Node.js dependencies | |
working-directory: frontend | |
run: | | |
# Generate a fresh package-lock.json and install dependencies | |
npm install --package-lock-only | |
npm install | |
- name: Build for ${{ matrix.os }} | |
run: poetry run python scripts/build.py --os ${{ matrix.build_os }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.release_name }} | |
path: dist/${{ matrix.artifact_name }} | |
# Create release after all builds complete | |
create_release: | |
needs: [check_release, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ needs.check_release.outputs.version }} | |
name: Release v${{ needs.check_release.outputs.version }} | |
files: | | |
dist/RTT-GCS-windows-x64.exe/Radio Telemetry Tracker Drone Ground Control Station.exe | |
dist/RTT-GCS-linux-x64/Radio Telemetry Tracker Drone Ground Control Station | |
dist/RTT-GCS-macos-x64/Radio Telemetry Tracker Drone Ground Control Station | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |