-
Notifications
You must be signed in to change notification settings - Fork 931
146 lines (116 loc) · 3.85 KB
/
test-latest-releases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: "Check: Check release on package managers"
run-name: "Check: Check release on package managers [${{ github.ref_name }}]"
on:
workflow_dispatch:
inputs:
major-version:
description: Major version to retrieve
required: true
type: choice
options:
- '8'
- '7'
version:
description: Version of CLI to check if it is present
type: string
required: true
claw-url:
description: Location of CLAW
type: string
required: true
default: https://packages.cloudfoundry.org
defaults:
run:
shell: bash
jobs:
test-homebrew:
name: Test Homebrew Repository
runs-on: macos-latest
env:
CLAW_URL: ${{ inputs.claw-url }}
VERSION_BUILD: ${{ inputs.version }}
VERSION_MAJOR: ${{ inputs.major-version }}
steps:
- name: Install CF CLI via Homebrew
run: |
set -evx
brew install cloudfoundry/tap/cf-cli@${VERSION_MAJOR}
installed_cf_version=$(cf${VERSION_MAJOR} version)
cf_location=$(which cf)
echo $cf_location
echo $installed_cf_version
echo ${VERSION_BUILD}
codesign --verify $cf_location || echo ---
cf -v | grep "${VERSION_BUILD}"
test-deb:
name: Test Debian Repository
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
CLAW_URL: ${{ inputs.claw-url }}
VERSION_BUILD: ${{ inputs.version }}
VERSION_MAJOR: ${{ inputs.major-version }}
steps:
- name: Install CF CLI via apt
run: |
set -o pipefail -e
sudo apt update
sudo apt install -y wget gnupg
wget -q -O - ${CLAW_URL}/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb ${CLAW_URL}/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt update
sudo apt install -y cf${VERSION_MAJOR}-cli
which cf
set -x
cf -v
cf${VERSION_MAJOR} -v
cf -v | grep "${VERSION_BUILD}"
test-rpm-repo:
name: Test RPM Repository
runs-on: ubuntu-latest
container:
image: fedora
env:
CLAW_URL: ${{ inputs.claw-url }}
VERSION_BUILD: ${{ inputs.version }}
VERSION_MAJOR: ${{ inputs.major-version }}
steps:
- name: Configure Custom CF Repository
run: |
curl -sL -o /etc/yum.repos.d/cloudfoundry-cli.repo \
${CLAW_URL}/fedora/cloudfoundry-cli.repo
- name: Install cf cli package
run: dnf install -y cf${VERSION_MAJOR}-cli
- name: Print CF CLI Versions
run: |
cf -v
cf${VERSION_MAJOR} -v
- name: Test Version Match
run: cf -v | grep -q "${VERSION_BUILD}"
test-windows:
name: Test Windows Chocolatey Package
runs-on: windows-2019
defaults:
run:
shell: pwsh
env:
VERSION_BUILD: ${{ inputs.version }}
VERSION_MAJOR: ${{ inputs.major-version }}
steps:
- name: Install cf cli package
run: choco install cloudfoundry-cli --version $env:VERSION_BUILD
- name: Print Chocolatey CF CLI Versions
run: |
cd 'C:/ProgramData/chocolatey/lib/cloudfoundry-cli/tools'
./cf -v
Invoke-Expression "./cf$env:VERSION_MAJOR -v"
- name: Test Chocolatey Version Match
run: |
cd 'C:/ProgramData/chocolatey/lib/cloudfoundry-cli/tools'
$found = (./cf -v | Select-String "$env:VERSION_BUILD")
if ($null -eq $found) {
Write-Error "CF CLI version $env:VERSION_BUILD was not found" -ErrorAction Stop
}
# vim: set sw=2 ts=2 sts=2 et tw=78 foldlevel=2 fdm=indent nospell: