-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(build-deb): Upload source package and run lintian #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,6 +12,10 @@ inputs: | |||||||||
token: | ||||||||||
required: false | ||||||||||
description: If provided, used for git authentication in the source build | ||||||||||
lintian: | ||||||||||
required: false | ||||||||||
description: Arguments to pass to lintian, if any. Set to false to skip the lintian chek. | ||||||||||
default: '' | ||||||||||
|
||||||||||
|
||||||||||
# The process: | ||||||||||
|
@@ -51,10 +55,20 @@ runs: | |||||||||
DEBIAN_FRONTEND=noninteractive sudo apt install -y devscripts | ||||||||||
echo "::endgroup::" | ||||||||||
|
||||||||||
echo "::group::Append commit SHA to local version" | ||||||||||
echo "::group::Create local version with commit and docker container" | ||||||||||
cd '${{ inputs.source-dir }}' | ||||||||||
sanitized_docker=$( echo "${{ inputs.docker-image }}" | sed 's/://' ) | ||||||||||
debchange --local "+${sanitized_docker}+${{ github.sha }}" "Github build. Job id: ${{ github.run_id }}. Attempt: ${{ github.run_number }}." | ||||||||||
|
||||||||||
# Sanitize the docker name so that it stick to debian policy | ||||||||||
# https://www.debian.org/doc/debian-policy/ch-controlfields.html#version | ||||||||||
sanitized_docker=$( echo "${{ inputs.docker-image }}" | sed -r 's/[^a-zA-Z0-9.+~]+/+/g' ) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally I'd use |
||||||||||
|
||||||||||
# Short commit to avoid "package-has-long-file-name" | ||||||||||
commit=$(echo ${{ github.sha }} | cut -c1-8) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we use git ourselves here? So we can ahve something fancier by using |
||||||||||
|
||||||||||
export DEBFULLNAME="GitHub actions runner" | ||||||||||
export DEBEMAIL="[email protected]" | ||||||||||
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or maybe latest commit author?
Suggested change
Plus an indication that is GH though, to make clear both things. |
||||||||||
debchange --local "~${sanitized_docker}+${commit}" "Github build. Run id: ${{ github.run_id }}. Run number: ${{ github.run_number }}." | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
echo "::endgroup::" | ||||||||||
|
||||||||||
echo "::group::Parsing name and version" | ||||||||||
|
@@ -79,6 +93,11 @@ runs: | |||||||||
if [ -n "${GITHUB_TOKEN}" ]; then | ||||||||||
git config --system url."https://api:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" | ||||||||||
fi | ||||||||||
- name: Run lintian | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally this should run in the same distro in which we build the package... So I'm wondering if we should fork the jtdor/build-deb-action@v1 action to support post-build-hooks or just a run-lintian option. |
||||||||||
if: inputs.lintian != 'false' | ||||||||||
shell: bash | ||||||||||
working-directory: ${{ env.SOURCE_OUTPUT_DIR }} | ||||||||||
run: lintian ${{ inputs.lintian }} -- *.changes | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
So we still see what's not exactly clean. Plus, IMHO, it would be nice to have an option to control There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I sorry ignore me on the Although, maybe this option is even too powerful, since IMHO any suppression should be in sources. |
||||||||||
- name: Set up package build | ||||||||||
shell: bash | ||||||||||
run: | | ||||||||||
|
@@ -106,7 +125,12 @@ runs: | |||||||||
artifacts-dir: ${{ env.BUILD_OUTPUT_DIR }} | ||||||||||
source-dir: ${{ env.BUILD_INPUT_DIR }} | ||||||||||
docker-image: ${{ inputs.docker-image }} | ||||||||||
- name: Upload artifacts | ||||||||||
- name: Copy source package to output dir | ||||||||||
shell: bash | ||||||||||
run: | | ||||||||||
set -eu | ||||||||||
cp -r ${{ env.SOURCE_OUTPUT_DIR }}/* ${{ env.BUILD_OUTPUT_DIR }} | ||||||||||
Comment on lines
+128
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, we should do this phase just after building the source, and ensure that this happens also if binary build fails: This can help a lot to debug situations failure situations, because one can download the sources locally and build them with Also in commit message, we mostly spell it as "art_i_fact" even if both words seems to be correct. |
||||||||||
- name: Upload artefacts | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> |
||||||||||
uses: actions/upload-artifact@v4 | ||||||||||
with: | ||||||||||
name: ${{ env.PKG_NAME }}_${{ env.PKG_VERSION }} | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
true
IMHO (to make it clearer at the reader as I see that by default it runs).Edit: I saw why it's unset, but as explained later I think we're maybe giving too much control to action users :)