Skip to content

Commit f2268ce

Browse files
Add new release valiation (#3301)
1 parent 4a2fcd2 commit f2268ce

File tree

2 files changed

+150
-1
lines changed

2 files changed

+150
-1
lines changed

.github/workflows/release-update-repos.yml

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

0 commit comments

Comments
 (0)