-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,77 +142,27 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
# Configure our SSH private key for pushing to the vendor repo | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.VENDOR_JSON_REPO_PUSH_KEY }} | ||
- name: Checkout vendor-jsons | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: PhotonVision/vendor-json-repo | ||
path: vendor-json-repo | ||
|
||
- name: Install Java 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
# grab all tags | ||
- run: git fetch --tags --force | ||
|
||
# Generate the JSON and give it the ""standard""" name maven gives it | ||
- run: | | ||
chmod +x gradlew | ||
./gradlew photon-lib:generateVendorJson | ||
mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-json-1.0.json | ||
export VERSION=$(git describe --tags --match=v*) | ||
mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-$(git describe --tags --match=v*).json | ||
# Upload it here so it shows up in releases | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: photonlib-vendor-json | ||
path: photon-lib/build/generated/vendordeps/photonlib-json-1.0.json | ||
|
||
- run: find . | ||
working-directory: vendor-json-repo | ||
|
||
- run: | | ||
export VERSION=$(git describe --tags --match=v*) | ||
cd vendor-json-repo | ||
git switch -C photonlib-$VERSION | ||
- run: git status | ||
working-directory: vendor-json-repo | ||
|
||
- run: | | ||
export VERSION=$(git describe --tags --match=v*) | ||
cp photon-lib/build/generated/vendordeps/photonlib-json-1.0.json vendor-json-repo/2025/photonlib-$(git describe --tags --match=v*).json | ||
name: Copy new JSON over | ||
# apparently we have to push or gh pr create gets upset | ||
- name: Commit and push | ||
run: | | ||
export VERSION=$(git describe --tags --match=v*) | ||
cd vendor-json-repo | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
git add . | ||
git commit -m "Update vendor JSON to $VERSION" | ||
git remote -v | ||
git remote set-url origin [email protected]:PhotonVision/vendor-json-repo.git | ||
git push --set-upstream origin photonlib-$VERSION -f | ||
# Cut a new release | ||
- run: | | ||
export VERSION=$(git describe --tags --match=v*) | ||
cd vendor-json-repo | ||
echo "${{ secrets.VENDOR_JSON_REPO_PUSH_TOKEN }}" > token.txt | ||
gh auth login --with-token < token.txt | ||
rm token.txt | ||
gh pr create --repo photonvision/vendor-json-repo --title "Update PhotonLib to $VERSION" --body "Automatic vendor JSON update" --base main --head photonvision:$(git branch --show-current) | ||
name: Create GH PR to the vendor-json-repo | ||
# Only on tags | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
path: photon-lib/build/generated/vendordeps/photonlib-*.json | ||
|
||
build-photonlib-host: | ||
env: | ||
|
@@ -574,7 +524,7 @@ jobs: | |
name: image-${{ matrix.image_suffix }} | ||
path: photonvision*.xz | ||
release: | ||
needs: [build-package, build-image, combine] | ||
needs: [build-package, build-image, combine, build-photonlib-vendorjson] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# Download all fat JARs | ||
|
@@ -592,6 +542,10 @@ jobs: | |
with: | ||
merge-multiple: true | ||
pattern: image-* | ||
# Download maven | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: photonlib-vendor-json | ||
|
||
- run: find | ||
# Push to dev release | ||
|