-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
c8b07e7
commit 95032fa
Showing
1 changed file
with
54 additions
and
38 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 |
---|---|---|
|
@@ -6,12 +6,9 @@ inputs: | |
description: Target repository | ||
required: false | ||
default: ${{ github.repository }} | ||
upload-built-template: | ||
library-name: | ||
required: false | ||
default: true | ||
project-name: | ||
required: false | ||
default: ${{ github.repository }} | ||
default: null | ||
|
||
runs: | ||
using: composite | ||
|
@@ -24,7 +21,7 @@ runs: | |
- run: cp -r ./pros-project/* ./ # its incredibly silly that I have to do this but otherwise it interferes with other checkouts | ||
shell: bash | ||
|
||
- name: Check if template | ||
- name: Check If Template | ||
id: template | ||
run: | | ||
template=$(awk -F'=' '/^IS_LIBRARY:=/{print $2}' Makefile) | ||
|
@@ -34,15 +31,15 @@ runs: | |
TEMPLATE: ${{ steps.template.outputs.template }} | ||
shell: bash | ||
|
||
- name: Get project info | ||
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template == true }} | ||
- name: Get Project Info | ||
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }} | ||
id: project-info | ||
shell: bash | ||
run: | | ||
if [ $ACTION = opened ]; then | ||
# we have to get the head sha directly from the pr api, because github silly ig | ||
echo "then" | ||
sha=$(wget -O- --quiet https://api.github.com/repos/LemLib/LemLib/pulls/$PR_NUM | jq -r .head.sha | head -c 6) | ||
sha=$(wget -O- --quiet https://api.github.com/repos/"${{inputs.repository}}"/pulls/$PR_NUM | jq -r .head.sha | head -c 6) | ||
else | ||
echo "else" | ||
sha=$(echo "$AFTER" | head -c 6) | ||
|
@@ -79,32 +76,51 @@ runs: | |
POSTFIX: ${{ steps.project-info.outputs.postfix }} | ||
NAME: ${{ steps.project-info.outputs.name }} | ||
|
||
#- name: Install ARM Toolchain | ||
#uses: fiam/arm-none-eabi-gcc@v1 | ||
#with: | ||
#release: "10-2020-q4" | ||
|
||
#- name: Setup Python | ||
#uses: actions/setup-python@v2 | ||
#with: | ||
#python-version: 3.9 | ||
|
||
#- name: PIP Installer | ||
#uses: BSFishy/pip-action@v1 | ||
#with: | ||
#packages: pros-cli | ||
|
||
#- name: Testing PROS Install | ||
#run: pros --version | ||
#shell: bash | ||
|
||
#- name: Checkout | ||
#uses: actions/checkout@v4 | ||
#with: | ||
#repository: ${{ inputs.repository }} | ||
#path: ./pros-project | ||
|
||
#- name: Build PROS Project | ||
#run: | | ||
#make clean quick -j | ||
#shell: bash | ||
- name: Install ARM Toolchain | ||
uses: fiam/arm-none-eabi-gcc@v1 | ||
with: | ||
release: "10-2020-q4" | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: PIP Installer | ||
uses: BSFishy/pip-action@v1 | ||
with: | ||
packages: pros-cli | ||
|
||
- name: Testing PROS Install | ||
run: pros --version | ||
shell: bash | ||
|
||
- name: Build PROS Project | ||
run: | | ||
make clean quick -j | ||
shell: bash | ||
|
||
- name: Prepare Template | ||
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }} | ||
shell: bash | ||
run: | | ||
pros make template | ||
mkdir -p template/include/lemlib/ | ||
cp {LICENSE,README.md} template/include/"${{inputs.library-name}}"/ | ||
echo "\n## [Github link](${{github.server_url}}/${{github.repository}})" >> template/include/"${{inputs.library-name}}"/README.md | ||
perl -i -pe 's@(?<=[^/])(docs/assets/.*?)(?=[")])@${{github.server_url}}/${{github.repository}}/blob/master/$1?raw=true@g' template/include/"${{inputs.library-name}}"/README.md | ||
echo $POSTFIX >> template/include/lemlib/VERSION | ||
- name: Unzip Template | ||
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }} | ||
uses: montudor/[email protected] | ||
with: | ||
args: unzip "${{steps.project-info.outputs.name}}.zip" -d template | ||
|
||
- name: Upload Artifact | ||
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.template-name.outputs.name }} | ||
path: "template/*" | ||
retention-days: 89 |