Skip to content

Commit 425a10b

Browse files
committed
Add install Azure CLI action
1 parent 0636624 commit 425a10b

2 files changed

Lines changed: 39 additions & 39 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Install Azure CLI'
2+
description: 'Install Azure CLI'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: uninstall azure-cli
7+
shell: bash
8+
run: |
9+
sudo apt-get remove -y azure-cli
10+
11+
- name: install azure-cli 2.61.0
12+
shell: bash
13+
run: |
14+
sudo apt-get update
15+
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
16+
sudo mkdir -p /etc/apt/keyrings
17+
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
18+
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
19+
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
20+
AZ_DIST=$(lsb_release -cs)
21+
echo "Types: deb
22+
URIs: https://packages.microsoft.com/repos/azure-cli/
23+
Suites: ${AZ_DIST}
24+
Components: main
25+
Architectures: $(dpkg --print-architecture)
26+
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
27+
sudo apt-get update
28+
sudo apt-get install azure-cli
29+
30+
apt-cache policy azure-cli
31+
# Obtain the currently installed distribution
32+
AZ_DIST=$(lsb_release -cs)
33+
# Store an Azure CLI version of choice
34+
AZ_VER=2.61.0
35+
# Install a specific version
36+
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades

.github/workflows/publish-azure-cc-enclave-docker.yaml

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -165,50 +165,14 @@ jobs:
165165
azureCc:
166166
name: Azure CC
167167
runs-on: ubuntu-latest
168-
# TODO
169-
permissions:
170-
contents: write
171-
security-events: write
172-
packages: write
173-
id-token: write
174-
pull-requests: write
168+
permissions: {}
175169
needs: buildImage
176-
# outputs:
177-
# jar_version: ${{ steps.update_version.outputs.new_version }}
178-
# image_tag: ${{ steps.update_version.outputs.image_tag }}
179170
steps:
180171
- name: Checkout
181172
uses: actions/checkout@v4
182173

183-
- name: uninstall azure-cli
184-
run: |
185-
sudo apt-get remove -y azure-cli
186-
187-
- name: install azure-cli 2.61.0
188-
run: |
189-
sudo apt-get update
190-
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
191-
sudo mkdir -p /etc/apt/keyrings
192-
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
193-
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
194-
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
195-
AZ_DIST=$(lsb_release -cs)
196-
echo "Types: deb
197-
URIs: https://packages.microsoft.com/repos/azure-cli/
198-
Suites: ${AZ_DIST}
199-
Components: main
200-
Architectures: $(dpkg --print-architecture)
201-
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
202-
sudo apt-get update
203-
sudo apt-get install azure-cli
204-
205-
apt-cache policy azure-cli
206-
# Obtain the currently installed distribution
207-
AZ_DIST=$(lsb_release -cs)
208-
# Store an Azure CLI version of choice
209-
AZ_VER=2.61.0
210-
# Install a specific version
211-
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades
174+
- name: Install Azure CLI
175+
uses: ./.github/actions/install_az_cli
212176

213177
- name: check azure-cli version
214178
run: |

0 commit comments

Comments
 (0)