Fix version number reading for CI release #370
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: "11" | |
- name: "Build all" | |
run: bazelisk build --config=athena --verbose_failures ... | |
- name: "Release: Get version number" | |
id: get_version | |
if: github.event_name == 'release' | |
run: echo "version=${GITHUB_REF_NAME:1}" >> "$GITHUB_OUTPUT" | |
- name: "Release: Get release info" | |
id: get_release_info | |
if: github.event_name == 'release' | |
uses: bruceadams/[email protected] | |
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 }}" //: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 }}" //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 | |
# 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 }}" //conduit/wpilibio:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip"' | |
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 }} --classifier linuxathena --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version }}-linuxathena.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Release: Upload "conduit/wpilibio:pom"' | |
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 }}" //conduit/wpilibio:pom.publish | |
env: | |
GITHUB_ACTOR: Mechanical-Advantage | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Upload Java packages | |
- name: 'Release: Upload "conduit/api"' | |
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 }}" //conduit/api:api-export.publish | |
- name: 'Release: Upload "junction/core"' | |
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 }}" //junction/core:core-export.publish | |
- name: 'Release: Upload "junction/autolog"' | |
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 }}" //junction/autolog:autolog-export.publish | |
- name: 'Release: Upload "junction/shims/wpilib"' | |
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 }}" //junction/shims/wpilib:wpilib-export.publish | |
desktop: | |
strategy: | |
matrix: | |
host: | |
- { os: macos-12, displayName: "macOS", classifier: "osxuniversal" } | |
- { | |
os: ubuntu-22.04, | |
displayName: "Linux", | |
classifier: "linuxx86-64", | |
} | |
- { | |
os: windows-2019, | |
displayName: "Windows", | |
classifier: "windowsx86-64", | |
} | |
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: "11" | |
- 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' | |
run: echo "version=${GITHUB_REF_NAME:1}" >> "$GITHUB_OUTPUT" | |
# 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 }}" //conduit/wpilibio/osxuniversal:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip" 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 }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/osxuniversal/wpilibio-${{ steps.get_version.outputs.version }}-${{ 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 }}" //conduit/wpilibio:nativezip | |
- name: 'Release: Upload "conduit/wpilibio:nativezip"' | |
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 }} --classifier ${{ matrix.host.classifier }} --file_path bazel-bin/conduit/wpilibio/wpilibio-${{ steps.get_version.outputs.version }}-${{ matrix.host.classifier }}.zip --username Mechanical-Advantage --access_token ${{ secrets.GITHUB_TOKEN }} |