Skip to content

Commit

Permalink
Add the output_exe option
Browse files Browse the repository at this point in the history
  • Loading branch information
ysdragon committed Oct 29, 2024
1 parent f31a57d commit bb722dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ An experimental GitHub Action that compiles a Ring project.
### `file` (required)
- **Description**: The path to the Ring file to build.

### `output_exe` (optional)
- **Description**: This can be set to 'true' to use Ring2EXE *(to output an executable file)*.
- **Default**: `false`

### `args` (optional)
- **Description**: Additional arguments to pass to Ring2EXE.

Expand All @@ -22,7 +26,7 @@ An experimental GitHub Action that compiles a Ring project.
Here’s an example of how to use this action in your workflow:

```yaml
uses: ysdragon/ring-action@v1.0.0
uses: ysdragon/ring-action@v1.0.1
with:
file: "program.ring"
```
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
file:
description: 'The Ring file to compile.'
required: true
output_exe:
description: 'This can be set to true to use Ring2EXE (to output an executable file).'
required: false
default: 'false'
args:
description: 'Optional command line flags for the Ring compiler. Use "-static" for static builds for example.'
required: false
Expand Down
12 changes: 9 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ "$INPUT_VERSION" != "v1.21.2" ]; then
popd
fi

# Check if the INPUT_RING_PACKAGE is not empty
# Check if the INPUT_RING_PACKAGES is not empty
if [ "$INPUT_RING_PACKAGES" != "" ]; then
# Split the input string into an array of packages
IFS=' ' read -r -a packages <<< "$INPUT_RING_PACKAGES"
Expand All @@ -47,5 +47,11 @@ if [ "$INPUT_RING_PACKAGES" != "" ]; then
done
fi

# Execute ring2exe with the provided arguments and input file
ring2exe $INPUT_ARGS $INPUT_FILE
# Check if the INPUT_OUTPUT_EXE is 'true'
if [ "$INPUT_OUTPUT_EXE" = "true" ]; then
# Execute ring2exe with the provided arguments and input file
ring2exe $INPUT_ARGS $INPUT_FILE
else
# Execute ring with the provided arguments and input file
ring $INPUT_ARGS $INPUT_FILE
fi

0 comments on commit bb722dc

Please sign in to comment.