@@ -4,13 +4,6 @@ description: Installs the Swift specified by a .swift-version file
44runs :
55 using : " composite"
66 steps :
7- # - name: "Cache: Swift"
8- # id: cache-swift
9- # uses: actions/cache@v4
10- # with:
11- # path: "$HOME/.local/share/swiftly"
12- # key: swift-${{ hashFiles('.swift-version') }}
13-
147 - name : Setup Environment
158 shell : bash
169 run : |
2215 echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> $GITHUB_ENV
2316 echo "SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> $HOME/.bashrc
2417
18+ export SWIFTLY_TOOLCHAINS_DIR="$HOME/.local/share/swiftly/toolchains"
19+ echo "SWIFTLY_TOOLCHAINS_DIR=$SWIFTLY_TOOLCHAINS_DIR" >> $GITHUB_ENV
20+ echo "SWIFTLY_TOOLCHAINS_DIR=$SWIFTLY_TOOLCHAINS_DIR" >> $HOME/.bashrc
21+
2522 echo "PATH=$SWIFTLY_BIN_DIR:$PATH" >> $GITHUB_ENV
2623 echo "PATH=\$SWIFTLY_BIN_DIR:\$PATH" >> $HOME/.bashrc
2724
3027 id : cache-swift
3128 with :
3229 path : " ~/.local/share/swiftly"
33- key : swift-${{ hashFiles('**/.swift-version') }}
30+ key : swift-${{ hashFiles('**/.swift-version', '.github/actions/install-swift/action.yml' ) }}
3431
3532 - name : Install `apt` Dependencies
3633 if : steps.cache-swift.outputs.cache-hit != 'true'
4643 if : steps.cache-swift.outputs.cache-hit != 'true'
4744 shell : bash
4845 run : |
46+ SWIFTLY_VERSION=1.0.1
4947 UNAME=$(uname -m)
50- curl -O "https://download.swift.org/swiftly/linux/swiftly-$UNAME.tar.gz"
51- tar zxf "swiftly-$UNAME.tar.gz"
48+ SWIFTLY_TGZ=swiftly-$SWIFTLY_VERSION-$UNAME.tar.gz
49+ curl -O "https://download.swift.org/swiftly/linux/$SWIFTLY_TGZ"
50+ tar zxf "$SWIFTLY_TGZ"
5251 ./swiftly init \
5352 --skip-install \
5453 --assume-yes \
6564 uses : actions/cache/save@v4
6665 with :
6766 path : " ~/.local/share/swiftly"
68- key : swift-${{ hashFiles('**/.swift-version') }}
67+ key : swift-${{ hashFiles('**/.swift-version', '.github/actions/install-swift/action.yml' ) }}
6968
7069 - name : Print Swift Version
7170 shell : bash
0 commit comments