Skip to content

Update to support 2025 Phoenix release #680

Update to support 2025 Phoenix release

Update to support 2025 Phoenix release #680

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
build-athena:
name: "Build for Athena"
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: "Install RoboRIO toolchain"
run: ./gradlew :akit:installRoboRioToolchain
- name: "Build and test"
run: ./gradlew :akit:build -Ponlylinuxathena
- name: "Development: Publish local"
if: github.event_name != 'release'
run: ./gradlew :akit:publishAllPublicationsToMavenRepository -Ponlylinuxathena
- name: "Release: Get version number"
id: get_version
if: github.event_name == 'release'
uses: battila7/get-version-action@v2
- name: "Release: Get release info"
id: get_release_info
if: github.event_name == 'release'
uses: bruceadams/get-release@v1.2.3
env:
GITHUB_TOKEN: ${{ github.token }}
- name: "Release: Publish remote"
if: github.event_name == 'release'
run: ./gradlew :akit:publish -Ponlylinuxathena "-PpublishingVersion=${{ steps.get_version.outputs.version-without-v }}"
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: "Release: Upload vendordep"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: akit/build/vendordep/AdvantageKit.json
asset_name: AdvantageKit.json
asset_content_type: application/json
- name: "Upload local repo"
uses: actions/upload-artifact@v4
with:
name: maven_Athena
path: akit/build/repos/releases
- name: "Generate template projects"
working-directory: template_projects
run: |
chmod +x generate_projects.sh
./generate_projects.sh
- name: "Release: Upload template project (kitbot_2025)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/kitbot_2025.zip
asset_name: AdvantageKit_KitBot2025Template.zip
asset_content_type: application/zip
- name: "Release: Upload template project (diff_drive)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/diff_drive.zip
asset_name: AdvantageKit_DiffDriveTemplate.zip
asset_content_type: application/zip
- name: "Release: Upload template project (spark_swerve)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/spark_swerve.zip
asset_name: AdvantageKit_SparkSwerveTemplate.zip
asset_content_type: application/zip
- name: "Release: Upload template project (talonfx_swerve)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/talonfx_swerve.zip
asset_name: AdvantageKit_TalonFXSwerveTemplate.zip
asset_content_type: application/zip
- name: "Release: Upload template project (vision)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/vision.zip
asset_name: AdvantageKit_VisionTemplate.zip
asset_content_type: application/zip
- name: "Release: Upload template project (skeleton)"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: template_projects/generated/skeleton.zip
asset_name: AdvantageKit_SkeletonTemplate.zip
asset_content_type: application/zip
build-desktop:
strategy:
matrix:
include:
- name: "Linux"
runner-image: ubuntu-latest
classifier: "linuxx86-64"
- name: "macOS"
runner-image: macos-latest
classifier: "osxuniversal"
- name: "Windows"
runner-image: windows-latest
classifier: "windowsx86-64"
name: "Build for ${{ matrix.name }}"
runs-on: ${{ matrix.runner-image }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Setup Java"
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: "Install Python dependencies"
run: pip install requests
- name: "Build and test"
run: ./gradlew :akit:build -Ponly${{ matrix.classifier }} -PskipJava=1
- name: "Development: Publish local"
if: github.event_name != 'release'
run: ./gradlew :akit:publishAllPublicationsToMavenRepository -Ponly${{ matrix.classifier }} -PskipJava=1
- name: "Release: Get version number"
id: get_version
if: github.event_name == 'release'
uses: battila7/get-version-action@v2
- name: "Release: Publish local"
if: github.event_name == 'release'
run: ./gradlew :akit:publishAllPublicationsToMavenRepository -Ponly${{ matrix.classifier }} -PskipJava=1 "-PpublishingVersion=${{ steps.get_version.outputs.version-without-v }}"
- name: "Release: Publish zip"
if: github.event_name == 'release'
run: |
python publish_zip.py --url https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release --group_id org.littletonrobotics.akit --artifact_id akit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.classifier }} --file_path akit/build/outputs/_M__GROUP_org_littletonrobotics_akit_ID_akit-wpilibio_CLS-${{ matrix.classifier }}.zip --username ${{ secrets.ARTIFACTORY_USERNAME }} --password ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: "Upload local repo"
uses: actions/upload-artifact@v4
with:
name: maven_${{ matrix.name }}
path: akit/build/repos/releases
combine:
name: "Combine Maven Offline"
runs-on: ubuntu-latest
needs: [build-athena, build-desktop]
steps:
- name: "Download Athena"
uses: actions/download-artifact@v4
with:
name: maven_Athena
path: maven_Athena
- name: "Download Linux"
uses: actions/download-artifact@v4
with:
name: maven_Linux
path: maven_Linux
- name: "Download macOS"
uses: actions/download-artifact@v4
with:
name: maven_macOS
path: maven_macOS
- name: "Download Windows"
uses: actions/download-artifact@v4
with:
name: maven_Windows
path: maven_Windows
- name: "Combine"
run: |
rsync -a maven_Athena/* maven_offline
rsync -a maven_macOS/* maven_offline
rsync -a maven_Linux/* maven_offline
rsync -a maven_Windows/* maven_offline
zip -r maven_offline.zip maven_offline
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: maven
path: maven_offline
- name: "Release: Get release info"
id: get_release_info
if: github.event_name == 'release'
uses: bruceadams/get-release@v1.2.3
env:
GITHUB_TOKEN: ${{ github.token }}
- name: "Release: Upload artifact"
uses: actions/upload-release-asset@v1
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: maven_offline.zip
asset_name: maven_offline.zip
asset_content_type: application/zip