Skip to content

Commit 6b8b5c6

Browse files
committed
Improve CI handling of generated script
1 parent 6c8b925 commit 6b8b5c6

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/build-and-snapshot.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,39 @@ jobs:
4848
name: cf-cli-java-plugin-${{ matrix.os }}
4949
path: dist/
5050

51+
- name: Install cf
52+
run: |
53+
if [ "$RUNNER_OS" == "Linux" ]; then
54+
# Ubuntu installation
55+
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cli.cloudfoundry.org.gpg
56+
echo "deb [signed-by=/usr/share/keyrings/cli.cloudfoundry.org.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
57+
sudo apt-get update
58+
sudo apt-get install -y cf8-cli
59+
elif [ "$RUNNER_OS" == "macOS" ]; then
60+
# macOS installation
61+
brew install cloudfoundry/tap/cf-cli@8
62+
elif [ "$RUNNER_OS" == "Windows" ]; then
63+
# Windows installation
64+
curl -L "https://packages.cloudfoundry.org/stable?release=windows64-exe&version=8&source=github-rel" -o cf8.zip
65+
unzip cf8.zip
66+
mkdir -p $HOME/bin
67+
mv cf8.exe $HOME/bin/cf.exe
68+
echo "$HOME/bin" >> $GITHUB_PATH
69+
else
70+
echo "Unsupported OS: $RUNNER_OS"
71+
exit 1
72+
fi
73+
5174
- name: Run 'cf java generate-alias-script'
5275
run: |
5376
make install
54-
cf java generate-alias-script > script.sh
77+
cf java generate-alias-script > dist/script.sh
5578
5679
- name: Upload script
5780
uses: actions/upload-artifact@v4
5881
with:
5982
name: script.sh
83+
path: dist/
6084

6185
release:
6286
name: Create Snapshot Release

0 commit comments

Comments
 (0)