Fix syntax in code examples #585
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: | |
release: | |
types: [published] | |
jobs: | |
athena: | |
name: Build for Athena | |
runs-on: ubuntu-22.04 | |
steps: | |
# Job setup & initial build | |
- name: "Checkout repository" | |
uses: actions/checkout@v3 | |
- name: "Setup Java" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: "Build all" | |
run: bazelisk build --config=athena --verbose_failures ... | |
- 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 }} | |
# Upload vendordep | |
- name: "Release: Generate vendordep" | |
if: github.event_name == 'release' | |
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //:vendordep | |
- 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: bazel-bin/AdvantageKit.json | |
asset_name: AdvantageKit.json | |
asset_content_type: application/json | |
# Upload example projects | |
- name: "Release: Generate example projects" | |
if: github.event_name == 'release' | |
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //example_projects | |
- name: "Release: Upload example 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: bazel-bin/example_projects/skeleton.zip | |
asset_name: AdvantageKit_SkeletonProject.zip | |
asset_content_type: application/zip | |
- name: "Release: Upload example 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: bazel-bin/example_projects/diff_drive.zip | |
asset_name: AdvantageKit_DiffDriveProject.zip | |
asset_content_type: application/zip | |
- name: "Release: Upload example project (swerve_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: bazel-bin/example_projects/swerve_drive.zip | |
asset_name: AdvantageKit_SwerveDriveProject.zip | |
asset_content_type: application/zip | |
- name: "Release: Upload example project (advanced_swerve_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: bazel-bin/example_projects/advanced_swerve_drive.zip | |
asset_name: AdvantageKit_AdvancedSwerveDriveProject.zip | |
asset_content_type: application/zip | |
- name: "Release: Upload example project (kitbot_2024)" | |
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: bazel-bin/example_projects/kitbot_2024.zip | |
asset_name: AdvantageKit_KitBot2024.zip | |
asset_content_type: application/zip | |
# Upload conduit build | |
- name: "Release: Install Dependencies" | |
if: github.event_name == 'release' | |
run: pip3 install requests | |
- name: 'Release: Build "conduit/wpilibio:nativezip"' | |
if: github.event_name == 'release' | |
run: bazelisk build --config=athena --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to local' | |
if: github.event_name == 'release' | |
run: python3 build_tools/repo/publish_zip.py --url file://$HOME/maven_offline --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier linuxathena --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-linuxathena.zip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to GitHub' | |
if: github.event_name == 'release' | |
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier linuxathena --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-linuxathena.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Release: Upload "conduit/wpilibio:pom" to local' | |
if: github.event_name == 'release' | |
run: bazelisk run --config=athena --define "maven_repo=file://$HOME/maven_offline" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:pom.publish | |
- name: 'Release: Upload "conduit/wpilibio:pom" to GitHub' | |
if: github.event_name == 'release' | |
run: bazelisk run --config=athena --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:pom.publish | |
env: | |
GITHUB_ACTOR: Mechanical-Advantage | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Upload Java packages | |
- name: 'Release: Upload "conduit/api" to local' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=file://$HOME/maven_offline" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/api:api-export.publish | |
- name: 'Release: Upload "conduit/api" to GitHub' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/api:api-export.publish | |
- name: 'Release: Upload "junction/core" to local' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=file://$HOME/maven_offline" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/core:core-export.publish | |
- name: 'Release: Upload "junction/core" to GitHub' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/core:core-export.publish | |
- name: 'Release: Upload "junction/autolog" to local' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=file://$HOME/maven_offline" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/autolog:autolog-export.publish | |
- name: 'Release: Upload "junction/autolog" to GitHub' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/autolog:autolog-export.publish | |
- name: 'Release: Upload "junction/shims/wpilib" to local' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=file://$HOME/maven_offline" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/shims/wpilib:wpilib-export.publish | |
- name: 'Release: Upload "junction/shims/wpilib" to GitHub' | |
if: github.event_name == 'release' | |
run: bazelisk run --define "maven_repo=https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit" --define "maven_user=Mechanical-Advantage" --define "maven_password=${{ secrets.GITHUB_TOKEN }}" --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //junction/shims/wpilib:wpilib-export.publish | |
# Upload local repo | |
- name: "Release: Upload local repo" | |
uses: actions/upload-artifact@v3 | |
if: github.event_name == 'release' | |
with: | |
name: maven_Athena | |
path: ~/maven_offline/ | |
desktop: | |
strategy: | |
matrix: | |
host: | |
- { | |
os: macos-12, | |
displayName: "macOS", | |
classifier: "osxuniversal", | |
mavenLocal: "file://$HOME/maven_offline", | |
mavenLocalUpload: "~/maven_offline", | |
} | |
- { | |
os: ubuntu-22.04, | |
displayName: "Linux", | |
classifier: "linuxx86-64", | |
mavenLocal: "file://$HOME/maven_offline", | |
mavenLocalUpload: "~/maven_offline", | |
} | |
- { | |
os: windows-2019, | |
displayName: "Windows", | |
classifier: "windowsx86-64", | |
mavenLocal: "file://%userprofile%\\maven_offline", | |
mavenLocalUpload: "%userprofile%/maven_offline", | |
} | |
name: Build for ${{ matrix.host.displayName }} | |
runs-on: ${{ matrix.host.os }} | |
steps: | |
# Job setup & initial build | |
- name: "Checkout repository" | |
uses: actions/checkout@v3 | |
- name: "Setup Java" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: "Build all" | |
run: bazelisk build --verbose_failures ... | |
- name: "Test all" | |
run: bazelisk test ... | |
- name: "Release: Get version number" | |
id: get_version | |
if: github.event_name == 'release' | |
uses: battila7/get-version-action@v2 | |
# Upload conduit build | |
- name: "Release: Install Dependencies" | |
if: github.event_name == 'release' | |
run: pip3 install requests | |
- name: 'Release: Build "conduit/wpilibio:nativezip" for macOS' | |
if: github.event_name == 'release' && matrix.host.displayName == 'macOS' | |
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio/osxuniversal:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to local for macOS' | |
if: github.event_name == 'release' && matrix.host.displayName == 'macOS' | |
run: python3 build_tools/repo/publish_zip.py --url ${{ matrix.host.mavenLocal }} --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/osxuniversal/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to GitHub for macOS' | |
if: github.event_name == 'release' && matrix.host.displayName == 'macOS' | |
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/osxuniversal/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Release: Build "conduit/wpilibio:nativezip"' | |
if: github.event_name == 'release' && matrix.host.displayName != 'macOS' | |
run: bazelisk build --define "publishing_version=${{ steps.get_version.outputs.version-without-v }}" //conduit/wpilibio:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to local' | |
if: github.event_name == 'release' && matrix.host.displayName != 'macOS' | |
run: python3 build_tools/repo/publish_zip.py --url ${{ matrix.host.mavenLocal }} --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" to GitHub' | |
if: github.event_name == 'release' && matrix.host.displayName != 'macOS' | |
run: python3 build_tools/repo/publish_zip.py --url https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit --group_id org.littletonrobotics.akit.conduit --artifact_id conduit-wpilibio --version ${{ steps.get_version.outputs.version-without-v }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version-without-v }}-${{ matrix.host.classifier }}.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} | |
# Upload local repo | |
- name: "Release: Upload local repo" | |
uses: actions/upload-artifact@v3 | |
if: github.event_name == 'release' | |
with: | |
name: maven_${{ matrix.host.displayName }} | |
path: ${{ matrix.host.mavenLocalUpload }} | |
combine: | |
name: "Release: Combine Maven Offline" | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
needs: [athena, desktop] | |
steps: | |
- name: "Download Athena" | |
uses: actions/download-artifact@v3 | |
with: | |
name: maven_Athena | |
path: maven_Athena | |
- name: "Download macOS" | |
uses: actions/download-artifact@v3 | |
with: | |
name: maven_macOS | |
path: maven_macOS | |
- name: "Download Linux" | |
uses: actions/download-artifact@v3 | |
with: | |
name: maven_Linux | |
path: maven_Linux | |
- name: "Download Windows" | |
uses: actions/download-artifact@v3 | |
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: "Get release info" | |
id: get_release_info | |
uses: bruceadams/get-release@v1.2.3 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: "Upload Maven zip" | |
uses: actions/upload-release-asset@v1 | |
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 |