Skip to content

Commit

Permalink
Add ring_packages option
Browse files Browse the repository at this point in the history
  • Loading branch information
ysdragon committed Oct 28, 2024
1 parent 4107d53 commit f31a57d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ An experimental GitHub Action that compiles a Ring project.
### `args` (optional)
- **Description**: Additional arguments to pass to Ring2EXE.

### `ring_packages` (optional)
- **Description**: Specifies the packages to install from RingPM.

### `version` (optional)
- **Description**: Specifies the version of the Ring compiler to use. This can be any valid reference for `git checkout`, such as a commit hash, tag, or branch.
- **Default**: `v1.21.2` *(Latest release)*
Expand All @@ -19,7 +22,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
uses: ysdragon/ring-action@v1.0.0
with:
file: "program.ring"
```
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: 'Build Ring Project'
description: 'A GitHub Action for building Ring projects within a Docker container.'
author: 'ysdragon'
inputs:
file:
description: 'The Ring file to compile.'
required: true
args:
description: 'Optional command line flags for the Ring compiler. Use "-static" for static builds for example.'
required: false
default: ''
file:
description: 'The Ring file to compile.'
required: true
ring_packages:
description: 'Optional command to install specified packages from RingPM.'
required: false
version:
description: 'Specify the version of the Ring compiler to use (commit ID, tag, branch, or hash).'
required: false
Expand Down
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,16 @@ if [ "$INPUT_VERSION" != "v1.21.2" ]; then
popd
fi

# Check if the INPUT_RING_PACKAGE 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"

# Loop through each package and install it
for package in "${packages[@]}"; do
ringpm install "$package"
done
fi

# Execute ring2exe with the provided arguments and input file
ring2exe $INPUT_ARGS $INPUT_FILE

0 comments on commit f31a57d

Please sign in to comment.