Skip to content

Commit ba15d13

Browse files
committed
Restarted repo for 2026
0 parents  commit ba15d13

File tree

191 files changed

+20119
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+20119
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/java:1-17-bookworm
2+
3+
# install dependencies
4+
RUN apt update
5+
RUN apt install -y python3-pip git-lfs
6+
RUN pip3 install --break-system-packages requests
7+
8+
# download WPILib extension
9+
COPY ./get-wpilib.py /opt
10+
RUN python3 /opt/get-wpilib.py

.devcontainer/devcontainer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/java
3+
{
4+
"name": "WS WPILib Java",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"options": [
8+
"--platform=linux/amd64"
9+
]
10+
},
11+
12+
// Configure tool-specific properties.
13+
"customizations": {
14+
"vscode": {
15+
"settings": {},
16+
"extensions": [
17+
"davidanson.vscode-markdownlint",
18+
"streetsidesoftware.code-spell-checker",
19+
"/tmp/wpilib.vsix"
20+
]
21+
}
22+
}
23+
}

.devcontainer/get-wpilib.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Determine the latest available WPILib release, then download the corresponding extension
2+
from requests import get
3+
from urllib.request import urlretrieve
4+
5+
RELEASES_URL = 'https://github.com/wpilibsuite/vscode-wpilib/releases'
6+
EXTENSION_PATH = '/tmp/wpilib.vsix'
7+
8+
res = get(f'{RELEASES_URL}/latest')
9+
if res.status_code == 200:
10+
version = res.url.split('/')[-1][1:]
11+
extension_url = f'{RELEASES_URL}/download/v{version}/vscode-wpilib-{version}.vsix'
12+
13+
print('Downloading:', extension_url, 'to', EXTENSION_PATH)
14+
urlretrieve(extension_url, EXTENSION_PATH)

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**Before Submitting:**
2+
3+
- Confirm there is a green ✔️ (not a red ❌) next to your last commit's date
4+
- Talk to a mentor about testing your code
5+
- Write a few sentences describing your changes below:
6+

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Docs Branch Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout source repository
15+
run: git clone https://wildstang:${{ secrets.UPDATE_PAT }}@github.com/wildstang/${{ github.event.repository.name }}.git
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 17
21+
22+
- name: Build javadoc with Gradle
23+
run: |
24+
cd ${{ github.event.repository.name }}
25+
./gradlew javadoc
26+
27+
- name: Push to destination repository
28+
run: |
29+
cd ${{ github.event.repository.name }}
30+
git config --global user.email "liam.fruzyna@wildstang.org"
31+
git config --global user.name "Automated Push"
32+
git add docs
33+
git commit -m "Javadoc build"
34+
git checkout -b docs
35+
git push --set-upstream origin docs --force

.github/workflows/gradle.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Robot CI
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 17
18+
- name: Build with Gradle
19+
run: ./gradlew build
20+
# - name: Build javadoc with Gradle
21+
# run: ./gradlew javadoc

.github/workflows/public.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Public Sync
2+
3+
on:
4+
push:
5+
branches:
6+
- public
7+
workflow_dispatch:
8+
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout source repository
15+
run: git clone -b public https://wildstang:${{ secrets.PAT }}@github.com/wildstang/${{ github.event.repository.name }}.git
16+
17+
- name: Determine project year and team number
18+
run: |
19+
cd ${{ github.event.repository.name }}
20+
echo $(python3 -c "import json;print(json.load(open('.wpilib/wpilib_preferences.json'))['projectYear']);") > year
21+
echo $(python3 -c "import json;print(json.load(open('.wpilib/wpilib_preferences.json'))['teamNumber']);") > team
22+
23+
- name: Add new remote
24+
run: |
25+
cd ${{ github.event.repository.name }}
26+
git remote add public_repo https://wildstang:${{ secrets.PAT }}@github.com/wildstang/$(cat year)_$(cat team)_robot_software.git
27+
git remote update
28+
29+
- name: Push to destination repository
30+
run: |
31+
cd ${{ github.event.repository.name }}
32+
git config --global user.email "liam.fruzyna@wildstang.org"
33+
git config --global user.name "Automated Push"
34+
git push -u public_repo public:main

.github/workflows/update-wpilib.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Determine the latest available WPILib release, then update build.gradle to match
2+
from requests import get
3+
from urllib.request import urlretrieve
4+
from re import search, sub
5+
from json import load
6+
7+
RELEASES_URL = 'https://github.com/wpilibsuite/vscode-wpilib/releases'
8+
FILE = 'build.gradle'
9+
10+
year = ''
11+
with open('.wpilib/wpilib_preferences.json') as f:
12+
year = load(f)['projectYear']
13+
14+
res = get(f'{RELEASES_URL}/latest')
15+
if res.status_code == 200:
16+
new_version = res.url.split('/')[-1][1:]
17+
18+
build_gradle = ''
19+
with open(FILE, 'r') as f:
20+
build_gradle = f.read()
21+
22+
match = search(year + r'\.[0-9]\.[0-9]', build_gradle)
23+
if match:
24+
old_version = match.group()
25+
if old_version != new_version:
26+
print(f'Replacing {old_version} with {new_version}')
27+
with open(FILE, 'w') as f:
28+
f.write(sub(old_version, new_version, build_gradle))
29+
else:
30+
print(f'{new_version} is the latest version')
31+
else:
32+
print(f'No version strings found in {FILE}')
33+
exit(2)
34+
else:
35+
print('Unable to determine latest version')
36+
exit(1)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: WPILib Update
2+
3+
on:
4+
schedule:
5+
- cron: "11 1 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source repository
14+
run: git clone https://wildstang:${{ secrets.UPDATE_PAT }}@github.com/wildstang/${{ github.event.repository.name }}.git
15+
16+
- name: Setup Git
17+
run: |
18+
cd ${{ github.event.repository.name }}
19+
git config --global user.email "liam.fruzyna@wildstang.org"
20+
git config --global user.name "Automated Push"
21+
22+
- name: Update the WPILib version
23+
run: |
24+
cd ${{ github.event.repository.name }}
25+
python3 .github/workflows/update-wpilib.py
26+
27+
- name: Commit update
28+
continue-on-error: true
29+
run: |
30+
cd ${{ github.event.repository.name }}
31+
git add build.gradle
32+
git commit -m "Updated WPILib version"
33+
34+
- name: Push update
35+
if: ${{ success() }}
36+
run: |
37+
cd ${{ github.event.repository.name }}
38+
git push

0 commit comments

Comments
 (0)