Skip to content

Commit

Permalink
Add apt-get release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lessley Dennington committed Jun 21, 2021
1 parent b72a77a commit 6fb6cc2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/configure_repoclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ def check_var(name:str) -> bool:
print(f"Required env var {name} is missing!")
exit(1)

for var in ['APT_REPO_ID', 'AZURE_AAD_ID', 'AAD_CLIENT_SECRET']:
for var in ['AZURE_AAD_ID', 'AAD_CLIENT_SECRET']:
check_var(var)

repo_id = env['APT_REPO_ID']
aad_id = env['AZURE_AAD_ID']
password = env['AAD_CLIENT_SECRET']

Expand All @@ -20,9 +19,9 @@ def check_var(name:str) -> bool:
"server": "azure-apt-cat.cloudapp.net",
"port": "443",

"repositoryId": repo_id,
"AADClientId": aad_id,
"AADClientSecret": password,
"repositoryId": ""
}

configs = [
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release-apt-get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "release-apt-get"
on: [push]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8

- uses: actions/checkout@v2

- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Download Repo Client'
env:
AZ_SUB: ${{ secrets.AZURE_SUBSCRIPTION }}
run: |
az storage blob download --subscription "$AZ_SUB" --account-name gitcitoolstore -c tools -n azure-repoapi-client_2.0.1_amd64.deb -f repoclient.deb --auth-mode login
- name: "Install Repo Client"
env:
AZURE_AAD_ID: ${{ secrets.AZURE_AAD_ID }}
AAD_CLIENT_SECRET: ${{ secrets.AAD_CLIENT_SECRET }}
run: |
sudo apt-get install python3-adal --yes
sudo dpkg -i repoclient.deb
python .github/configure_repoclient.py
rm repoclient.deb
- name: "Publish to apt feed"
env:
RELEASE: ${{ github.event.inputs.release }}
run: |
pip install requests
python .github/fetch_release.py
wget "$(cat asset_url.txt)"
for id in ${{ secrets.BIONIC_REPO_ID }} ${{ secrets.HIRSUTE_REPO_ID }}
do
repoclient -v v3 -c config.json package add --check --wait 300 "$(cat asset_name.txt)" -r $id
done

0 comments on commit 6fb6cc2

Please sign in to comment.