Skip to content

Commit

Permalink
Add github action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dsteeley committed Sep 19, 2024
1 parent 8a2ae7e commit 867b4ce
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
steps:
- name: Install dependencies
run: unset HOME; tdnf install -y build-essential git tar rpm-build ca-certificates
- uses: actions/checkout@v2
- name: build
run: make rpm
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release

on: push

jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/cbl-mariner/base/core:2.0
permissions:
contents: write
steps:
- name: Install dependencies
run: unset HOME; tdnf install -y build-essential git tar rpm-build ca-certificates
- uses: actions/checkout@v2
- name: build
run: make rpm
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
rpmbuild/RPMS/x86_64/*.rpm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
rpmbuild/
3 changes: 2 additions & 1 deletion azure_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def get_token():
stdout=subprocess.PIPE,
)
except subprocess.CalledProcessError as e:
# Try again if we are running as sudo in case our user has permission but the sudo user doesn't.
# Upon an error if running as sudo try again without runuser in case our user
# has permission on the storage account but the sudo user doesn't.
if "SUDO_USER" in os.environ:
output = subprocess.run(
AZ_COMMAND,
Expand Down

0 comments on commit 867b4ce

Please sign in to comment.