Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleCh1cken committed May 9, 2024
1 parent a60a045 commit 9bc31de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Test With Upload + Bonus Files
uses: ./action/
with:
library-name: LemLib
library-path: lemlib

test-lemlib-without-upload:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,4 +66,4 @@ jobs:
- name: Test With Upload + Bonus Files
uses: ./action/
with:
library-name: EZ-Template
library-path: EZ-Template
23 changes: 13 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Pros Build
description: Automatically build pros projects

inputs:
library-name:
library-path:
required: false
default: null
description: The path of the library inside of the `include` directory. Specifying a value for this input will cause the action to upload the built libary in template form as an artifact.

runs:
using: composite
Expand All @@ -20,7 +21,7 @@ runs:
shell: bash

- name: Get Project Info
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
if: ${{ steps.template.outputs.template == 1 && inputs.library-path != null }}
id: project-info
shell: bash
run: |
Expand Down Expand Up @@ -82,7 +83,7 @@ runs:
shell: bash

- name: Prepare Template
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
if: ${{ steps.template.outputs.template == 1 && inputs.library-path != null }}
shell: bash
run: |
# Update version in Makefile
Expand All @@ -91,20 +92,22 @@ runs:
pros make template
mkdir -p template/include/"${{inputs.library-name}}"/
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 ${{steps.project-info.outputs.postfix}} >> template/include/${{inputs.library-name}}/VERSION
mkdir -p template/include/"${{inputs.library-path}}"/
cp {LICENSE*,README*} template/include/"${{inputs.library-path}}"/
echo "\n## [Github link](${{github.server_url}}/${{github.repository}})" >> template/include/"${{inputs.library-path}}"/README.md
perl -i -pe 's@(?<=[^/])(docs/assets/.*?)(?=[")])@${{github.server_url}}/${{github.repository}}/blob/master/$1?raw=true@g' template/include/"${{inputs.library-path}}"/README.md
echo ${{steps.project-info.outputs.postfix}} >> template/include/${{inputs.library-path}}/VERSION
- name: Unzip Template
if: ${{ steps.template.outputs.template == 1 && inputs.library-name != null }}
if: ${{ steps.template.outputs.template == 1 && inputs.library-path != 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 }}
if: ${{ steps.template.outputs.template == 1 && inputs.library-path != null }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.project-info.outputs.name }}
Expand Down

0 comments on commit 9bc31de

Please sign in to comment.