Add new GC setup to templates #639
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: 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: | |
GITHUB_ACTOR: Mechanical-Advantage | |
GITHUB_TOKEN: ${{ github.token }} | |
- 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 | |
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://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --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 Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} | |
- 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 |