Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 4 additions & 31 deletions .github/workflows/build-deb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ jobs:
- name: Mark working directory as safe
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- name: Fetch all branches
run: git fetch --tags

- name: update branch name
run: |
safe_branch=$(echo "${GITHUB_REF_NAME}" | tr '/' '-')
Expand All @@ -72,7 +69,7 @@ jobs:
- name: Collect .deb artifact
run: |
mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }}
mv ../libosal_*.deb artifacts/${{ matrix.os }}/${{ matrix.version }}
mv ../libosal*.deb artifacts/${{ matrix.os }}/${{ matrix.version }}

- name: Set sanitized image name
id: sanitize
Expand All @@ -88,18 +85,14 @@ jobs:
name: libosal-${{ steps.sanitize.outputs.sanitized_image }}.deb
path: artifacts/${{ matrix.os }}/${{ matrix.version }}/*.deb

- name: Ensure package is present
run: |
echo "Files in workspace:"
find *

- name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }})
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
shell: bash
run: |
VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb"
FILENAME_DEV="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-dev_${VERSION}_amd64.deb"

python3 -m venv cloudsmith
cd cloudsmith
Expand All @@ -108,30 +101,10 @@ jobs:
python3 -m pip install --upgrade pip
pip3 install cloudsmith-cli

cloudsmith push deb robert-burger-AdLL/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \
cloudsmith push deb robertburger/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \
--republish \
--api-key "$CLOUDSMITH_API_KEY"

- name: Collect devel .deb artifact
run: |
mkdir -p artifacts/${{ matrix.os }}/${{ matrix.version }}
mv ../libosal-dev*.deb artifacts/${{ matrix.os }}/${{ matrix.version }}

- name: Upload devel to Cloudsmith (${{ matrix.os }}/${{ matrix.version }})
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
shell: bash
run: |
VERSION=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal-dev_${VERSION}_amd64.deb"

python3 -m venv cloudsmith
cd cloudsmith
source bin/activate

python3 -m pip install --upgrade pip
pip3 install cloudsmith-cli

cloudsmith push deb robert-burger-AdLL/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME} \
cloudsmith push deb robertburger/common/${{ matrix.os }}/${{ matrix.version }} ../${FILENAME_DEV} \
--republish \
--api-key "$CLOUDSMITH_API_KEY"