Skip to content

Update cmake-multi-platform.yml#7

Merged
robert-burger merged 84 commits intomasterfrom
feat/tag-build
Jul 16, 2025
Merged

Update cmake-multi-platform.yml#7
robert-burger merged 84 commits intomasterfrom
feat/tag-build

Conversation

@robert-burger
Copy link
Owner

No description provided.

@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Comment on lines +13 to +110
runs-on: ubuntu-latest

env:
DEB_BUILD_OPTIONS: nocheck # or whatever options you need
strategy:
matrix:
distro: [debian-bookworm, debian-bullseye, ubuntu-24.04, ubuntu-22.04]
include:
- distro: debian-bookworm
image: debian:bookworm
os: debian
version: bookworm
- distro: debian-bullseye
image: debian:bullseye
os: debian
version: bullseye
- distro: ubuntu-24.04
image: ubuntu:24.04
os: ubuntu
version: noble
- distro: ubuntu-22.04
image: ubuntu:22.04
os: ubuntu
version: jammy
container:
image: ${{ matrix.image }}
steps:
- name: Install build dependencies
run: |
apt-get update
apt-get install -y build-essential devscripts debhelper autotools-dev fakeroot sed git python3-pip curl jq

- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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 '/' '-')
sed "s|BRANCH_VERSION|$safe_branch|" configure.ac.in > configure.ac
env:
GITHUB_REF_NAME: ${{ github.ref_name }}

- name: Prepare autotools
run: |
# Nur falls nicht schon vorhanden (optional)
autoreconf -fi

- name: Build .deb package
run: |
# baue mit dpkg-buildpackage (ohne signieren)
dpkg-buildpackage -us -uc -d

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

- name: Set sanitized image name
id: sanitize
run: |
version=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
echo "sanitized_image=$(echo "$version-$IMAGE" | tr '/:' '--')" >> $GITHUB_OUTPUT
env:
IMAGE: ${{ matrix.image }}

- name: Upload .deb package
uses: actions/upload-artifact@v4
with:
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: Set up Python and install cloudsmith-cli
run: |
python -m pip install --upgrade pip
pip install cloudsmith-cli


- name: Upload to Cloudsmith (${{ matrix.os }}/${{ matrix.version }})
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
FILENAME="artifacts/${{ matrix.os }}/${{ matrix.version }}/libosal_${VERSION}_amd64.deb"
cloudsmith push deb robert-burger-AdLL/libosal/${{ matrix.os }}/${{ matrix.version }} ${FILENAME} \
--republish \
--api-key "$CLOUDSMITH_API_KEY"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 8 months ago

To fix the issue, we need to add a permissions block to the workflow. This block should specify the least privileges required for the workflow to function correctly. Based on the operations performed in the workflow, the following permissions are appropriate:

  • contents: read for accessing repository contents.
  • packages: write for uploading packages to Cloudsmith.

The permissions block can be added at the root level of the workflow to apply to all jobs, or within the build-deb job to limit permissions to that specific job.


Suggested changeset 1
.github/workflows/build-deb.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml
--- a/.github/workflows/build-deb.yaml
+++ b/.github/workflows/build-deb.yaml
@@ -2,2 +2,6 @@
 
+permissions:
+  contents: read
+  packages: write
+
 on:
EOF
@@ -2,2 +2,6 @@

permissions:
contents: read
packages: write

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@robert-burger robert-burger merged commit 7666064 into master Jul 16, 2025
4 checks passed
@robert-burger robert-burger deleted the feat/tag-build branch July 18, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant