Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into docs/vision-processing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewL246 committed Nov 27, 2023
2 parents eb3da63 + b8e2fbd commit b12e594
Show file tree
Hide file tree
Showing 11 changed files with 273 additions and 188 deletions.
28 changes: 16 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
interval: daily
allow:
- dependency-name: "*"
dependency-type: "all"
assignees: ["MatthewL246", "michaell4438"]
- dependency-name: '*'
dependency-type: all
assignees:
- MatthewL246
- michaell4438
open-pull-requests-limit: 10

- package-ecosystem: "gradle"
directory: "/"
- package-ecosystem: gradle
directory: /
schedule:
interval: "daily"
interval: daily
allow:
- dependency-name: "*"
dependency-type: "all"
assignees: ["MatthewL246", "michaell4438"]
- dependency-name: '*'
dependency-type: all
assignees:
- MatthewL246
- michaell4438
open-pull-requests-limit: 10
87 changes: 44 additions & 43 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,54 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Build with Gradle
run: ./gradlew assembleDebug --scan --stacktrace --info --no-daemon -x test

- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: TeamCode-debug.apk
path: TeamCode/build/outputs/apk/debug/TeamCode-debug.apk
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle

- name: Build with Gradle
run: ./gradlew assembleDebug --scan --stacktrace --info --no-daemon -x test

- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: TeamCode-debug.apk
path: TeamCode/build/outputs/apk/debug/TeamCode-debug.apk

release:
runs-on: ubuntu-latest
needs: [ 'build' ]
needs:
- build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
concurrency:
group: 'release'
cancel-in-progress: true
group: release
cancel-in-progress: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download the APK artifact
uses: actions/download-artifact@v3
with:
name: TeamCode-debug.apk

- name: Update the release tag
run: |
git tag -d latest-ci-build
git tag latest-ci-build
git push origin latest-ci-build --force
- name: Update the release
run: |
gh release upload latest-ci-build TeamCode-debug.apk --clobber
gh release edit latest-ci-build --prerelease --notes "This build was made from commit ${{ github.sha }}."
env:
GH_TOKEN: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download the APK artifact
uses: actions/download-artifact@v3
with:
name: TeamCode-debug.apk

- name: Update the release tag
run: |
git tag -d latest-ci-build
git tag latest-ci-build
git push origin latest-ci-build --force
- name: Update the release
run: |
gh release upload latest-ci-build TeamCode-debug.apk --clobber
gh release edit latest-ci-build --prerelease --notes "This build was made from commit ${{ github.sha }}."
env:
GH_TOKEN: ${{ github.token }}
154 changes: 116 additions & 38 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,144 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

# Before changing any of these workflow triggers, make sure you understand the if statements for each of the jobs
on:
# Run automatically after the Android CI release finishes
workflow_run:
workflows: [ "Android CI" ]
branches: [ "master" ]
types: [ "completed" ]
workflows:
- Android CI
branches:
- master
types:
- completed
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# Run on pull requests to master
pull_request:
# Note that this specifies the target branch, not the branch that the PR is from
branches:
- master

jobs:
# Single deploy job since we're just deploying
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
# Run if the Android CI build was successful, on PRs from docs/ branches, or if this is a manual workflow run
if: ${{ github.event.workflow_run.conclusion == 'success' || startsWith(github.head_ref, 'docs/') || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Website
run: |
echo -e "Running build script with Python..."
python deploy.py
echo -e "Script complete."
shell: bash

- name: Build website
run: ./build.sh
working-directory: ./HelpPage/scripts/

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-version: 11
distribution: temurin
cache: gradle

- name: Build JavaDoc using Dokka
run: |
./gradlew :TeamCode:dokkaHtml --no-daemon
mv ./TeamCode/build/dokka/html ./HelpPage/opt/javadoc
mv ./TeamCode/build/dokka/html ./HelpPage/build/javadoc
- name: Upload Pages build artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages-build
path: ./HelpPage/build
retention-days: 90

deploy:
# Only run deployment from the master branch and not on pull requests
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
needs:
- build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Only allow one concurrent deployment
concurrency:
group: pages-deploy
cancel-in-progress: false

steps:
- name: Configure Pages
uses: actions/configure-pages@v3

- name: Download Pages build artifact
uses: actions/download-artifact@v3
with:
name: github-pages-build

- name: Extract Pages build artifact
run: |
mkdir pages-build
tar -xvf artifact.tar -C pages-build
- name: Download the latest APK
run: |
mkdir -p ./HelpPage/opt/apk/bin
cd ./HelpPage/opt/apk/bin
mkdir -p ./pages-build/apk/bin
cd ./pages-build/apk/bin
curl -LO https://github.com/XaverianTeamRobotics/FtcRobotController/releases/download/latest-ci-build/TeamCode-debug.apk
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload Artifact
- name: Upload final Pages artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload final build
path: './HelpPage/opt'
name: github-pages-deploy
path: ./pages-build
retention-days: 90

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main
uses: actions/deploy-pages@v2
with:
artifact_name: github-pages-deploy

test-deploy:
needs:
- build
runs-on: ubuntu-latest
# Only allow one concurrent test deployment per branch
concurrency:
group: pages-test-deploy-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Download Pages build artifact
uses: actions/download-artifact@v3
with:
name: github-pages-build

- name: Extract Pages build artifact
run: |
mkdir pages-build
tar -xvf artifact.tar -C pages-build
- name: Upload build to Cloudflare Pages
id: test-deployment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: xbhs-robotics-docs
directory: pages-build

- name: Add comment with test deployment URL
if: ${{ github.event_name == 'pull_request' }}
run: >
gh pr comment ${{ github.event.number }}
--repo ${{ github.repository }}
--body "Your docs changes were built successfully!
View a preview of them at ${{ steps.test-deployment.outputs.url }}"
env:
GH_TOKEN: ${{ github.token }}
12 changes: 6 additions & 6 deletions HelpPage/doc/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ const config = {
position: "right",
items: [
{
href: "https://robotics.xbhs.net/apk",
href: "/apk/",
label: "Flash Robot Controller APK"
},
{
href: "https://robotics.xbhs.net/legacy-apk",
href: "/legacy-apk/",
label: "Download Driver Station APK"
},
{
href: "https://robotics.xbhs.net/imgutil",
href: "/imgutil/",
label: "Upload Images to robotics.xbhs.com"
},
]
Expand All @@ -130,15 +130,15 @@ const config = {
position: "right",
items: [
{
href: "https://robotics.xbhs.net/javadoc",
href: "/javadoc/",
label: "Javadoc (all)"
},
{
href: "https://robotics.xbhs.net/javadoc/-team-code/org.firstinspires.ftc.teamcode.features/index.html",
href: "/javadoc/-team-code/org.firstinspires.ftc.teamcode.features/index.html",
label: "Javadoc (features)"
},
{
href: "https://robotics.xbhs.net/javadoc/-team-code/org.firstinspires.ftc.teamcode.opmodes/index.html",
href: "/javadoc/-team-code/org.firstinspires.ftc.teamcode.opmodes/index.html",
label: "Javadoc (opmodes)"
},
]
Expand Down
2 changes: 0 additions & 2 deletions HelpPage/scripts/README.md

This file was deleted.

31 changes: 31 additions & 0 deletions HelpPage/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

set -eu

echo Running build...
rm -rf ../build

echo Building Docusaurus...
cd ../doc
npm install
npm run build
echo Docusaurus build complete.

echo Building imgutil...
cd ../imgutil
npm install
npm run build
echo Imgutil build complete.

echo "Bundling..."
cd ..
mkdir output
# Move docusaurus build to final output
mv ./doc/build ./build
# Move imgutil build to final output
mv ./imgutil/dist ./build/imgutil
# Move static files to final output
mv ./apk ./build/apk
mv ./legacy-apk ./build/legacy-apk

echo Build complete.
Loading

0 comments on commit b12e594

Please sign in to comment.