Skip to content

Commit

Permalink
Make it possible to specify xcodegen's version
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierLowmiller committed Apr 25, 2020
1 parent cb69d9e commit f278383
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ The path to the directory where the project should be generated. Defaults to the
* `use-cache`:
Use a cache for the xcodegen spec. This will prevent unnecessarily generating the project if nothing has changed

Additionally, the version of xcodegen can be specified:

* `version`:
The version of xcodegen to be used. Check <https://github.com/yonaskolb/XcodeGen/releases> for valid options.

## Example usage

Expand All @@ -29,6 +33,7 @@ uses: xavierLowmiller/[email protected]
with:
spec: project.yaml
quiet: true
version: '2.15.1'
```
[xcodegen]: https://github.com/yonaskolb/XcodeGen
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ inputs:
description: 'The path to the project spec file. Defaults to project.yml'
use-cache:
description: 'Use a cache for the xcodegen spec. This will prevent unnecessarily generating the project if nothing has changed'
version:
description: 'The version of xcodegen to be used. Check https://github.com/yonaskolb/XcodeGen/releases for valid options.'
default: latest
runs:
using: 'node12'
main: 'index.js'
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ try {
async function installXcodegen() {
const xcodegenDir = os.homedir() + '/action-xcodegen/'
const zipFile = xcodegenDir + 'xcodegen.zip'
const version = core.getInput('version')
await exec.exec('curl', [
'--silent',
'--create-dirs',
'--location',
'--output',
zipFile,
'https://github.com/yonaskolb/XcodeGen/releases/latest/download/xcodegen.zip'
`https://github.com/yonaskolb/XcodeGen/releases/download/${version}/xcodegen.zip`
])
await exec.exec('unzip', ['-q', '-o', zipFile], { cwd: xcodegenDir })
await exec.exec('rm', [zipFile])
Expand Down

0 comments on commit f278383

Please sign in to comment.