Skip to content

Commit b612e40

Browse files
committed
update workflow
1 parent 057aa9b commit b612e40

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/actions/install-swift/action.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030
key: swift-${{ runner.os }}-${{ hashFiles('**/.swift-version', '.github/actions/install-swift/action.yml') }}
3131

3232
- name: Install `apt` Dependencies
33-
if: steps.cache-swift.outputs.cache-hit != 'true'
33+
if: runner.os == 'Linux' && steps.cache-swift.outputs.cache-hit != 'true'
3434
shell: bash
3535
run: |
3636
SUDO=$(if [[ $EUID -ne 0 ]]; then echo sudo; fi)
@@ -40,7 +40,7 @@ runs:
4040
DEBIAN_FRONTEND: noninteractive
4141

4242
- name: Install Swiftly
43-
if: steps.cache-swift.outputs.cache-hit != 'true'
43+
if: runner.os == 'Linux' && steps.cache-swift.outputs.cache-hit != 'true'
4444
shell: bash
4545
run: |
4646
SWIFTLY_VERSION=1.0.1
@@ -54,6 +54,21 @@ runs:
5454
--quiet-shell-followup \
5555
--no-modify-profile
5656
57+
- name: Install Swiftly
58+
if: runner.os == 'macOS' && steps.cache-swift.outputs.cache-hit != 'true'
59+
shell: bash
60+
run: |
61+
SWIFTLY_VERSION=1.0.1
62+
UNAME=$(uname -m)
63+
SWIFTLY_PKG=swiftly-$SWIFTLY_VERSION.pkg
64+
curl -O "https://download.swift.org/swiftly/darwin/$SWIFTLY_PKG"
65+
installer -pkg $SWIFTLY_PKG -target CurrentUserHomeDirectory
66+
./swiftly init \
67+
--skip-install \
68+
--assume-yes \
69+
--quiet-shell-followup \
70+
--no-modify-profile
71+
5772
- name: Install Swift
5873
if: steps.cache-swift.outputs.cache-hit != 'true'
5974
shell: bash

0 commit comments

Comments
 (0)