Skip to content

Commit

Permalink
Merge branch 'release/2.0.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Mar 2, 2021
2 parents e798f76 + 59e9450 commit ce50841
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
[![Unit Tests](https://github.com/sinoru/actions-setup-swift/actions/workflows/units.yml/badge.svg)](https://github.com/sinoru/actions-setup-swift/actions/workflows/test.yml)
[![Tests](https://github.com/sinoru/actions-setup-swift/actions/workflows/tests.yml/badge.svg)](https://github.com/sinoru/actions-setup-swift/actions/workflows/test.yml)

This action sets up a swift environment using [swiftenv](https://github.com/kylef/swiftenv) for use in actions by:
This action sets up a swift environment for use in actions by:

- optionally downloading a version of swift from swift.org.
- supports macOS, Linux runner.
- optionally downloading a version of swift from swift.org using [swiftenv](https://github.com/kylef/swiftenv).

# Usage

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Swift (swiftenv)'
description: 'Set up a specific version of swift using swiftenv'
name: 'Setup Swift environment'
description: 'Setup a Swift environment and optionally downloading and adding it to the PATH'
branding:
icon: 'feather'
color: 'orange'
Expand Down
10 changes: 9 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ async function installSwiftenv() {
core.endGroup();
}

async function installSwift(options = {}) {
core.startGroup('Install swift');

await swiftenv.install(options);

core.endGroup();
}

async function setupSwift() {
const swiftVersion = core.getInput('swift-version', { required: false });

await installEssentials();
await installSwiftenv();
await swiftenv.install({'swiftVersion': swiftVersion, 'debug': core.isDebug()});
await installSwift({'swiftVersion': swiftVersion, 'debug': core.isDebug()});
}

// most @actions toolkit packages have async methods
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "actions-setup-swift",
"version": "2.0.1",
"description": "Set up a specific version of swift using swiftenv",
"version": "2.0.2",
"description": "Setup a Swift environment and optionally downloading and adding it to the PATH",
"main": "index.mjs",
"scripts": {
"lint": "eslint .",
Expand Down

0 comments on commit ce50841

Please sign in to comment.