Skip to content
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

github-action publishing uploads master package as well (i.e. python/ffmpeg) #5870

Closed
1 task done
th0ma7 opened this issue Sep 7, 2023 · 4 comments · Fixed by #5874 or #5876
Closed
1 task done

github-action publishing uploads master package as well (i.e. python/ffmpeg) #5870

th0ma7 opened this issue Sep 7, 2023 · 4 comments · Fixed by #5874 or #5876
Assignees
Labels

Comments

@th0ma7
Copy link
Contributor

th0ma7 commented Sep 7, 2023

Is this a new Bug?

  • I checked that the bug hasn't been reported before

Package Name

deluge

Package Version

any

Device Model

any

Device Architecture

x86_64

Firmware Version

unrelated

What happened?

Invoking builds + upload through github-action for shared packages (i.e. using python311 of ffmpeg) ends-up uploading both artifacts instead of the resulting package being built. This ends-up generating errors:

SUCCESS:
2023.09.07 01:35:03 - sabnzbd: (evansport-7.1) DONE

ARTIFACTS:
-rw-r--r-- 1 root  27M 2023.09.07 01:31:30 packages/python311_evansport-7.1_3.11.5-8.spk
-rw-r--r-- 1 root 6.3M 2023.09.07 01:35:01 packages/sabnzbd_evansport-7.1_4.0.3-65.spk


UNSUPPORTED (skipped):
none.

Error: ERRORS:
2023.09.07 01:31:33 - python311: (evansport-7.1) FAILED

See log file of the build job to analyze the error(s).

Last [15](https://github.com/th0ma7/spksrc/actions/runs/6103372968/job/16563729213#step:7:16) lines of the build log:


$ make publish-arch-evansport-7.1 -C ./spk/python311
/github/workspace/mk/wizard/uninstall_uifile
(cd /github/workspace/spk/python311/work-evansport-7.1 && tar cpf /github/workspace/spk/python311/../../packages/python311_evansport-7.1_3.11.5-8.spk --group=root --owner=root package.tgz INFO scripts conf PACKAGE_ICON.PNG PACKAGE_ICON_256.PNG WIZARD_UIFILES)
ERROR: Failed to publish package - HTTP response code 409
HTTP/1.1 409 CONFLICT
Server: nginx/1.25.1
Date: Thu, 07 Sep [20](https://github.com/th0ma7/spksrc/actions/runs/6103372968/job/16563729213#step:7:21)[23](https://github.com/th0ma7/spksrc/actions/runs/6103372968/job/16563729213#step:7:24) 01:[31](https://github.com/th0ma7/spksrc/actions/runs/6103372968/job/16563729213#step:7:32):[33](https://github.com/th0ma7/spksrc/actions/runs/6103372968/job/16563729213#step:7:34) GMT
Content-Type: application/json
Content-Length: 52
Connection: keep-alive

{"message": "Conflicting architectures: evansport"}
make[1]: *** [../../mk/spksrc.spk.mk:481: publish] Error 1
make[1]: Leaving directory '/github/workspace/spk/python311'
make: *** [../../mk/spksrc.spk.mk:709: publish-arch-evansport-7.1] Error 1
make: Leaving directory '/github/workspace/spk/python311'

Reproduction steps

n/a

Install Log

n/a

Service Log

No response

Other Logs

No response

@th0ma7
Copy link
Contributor Author

th0ma7 commented Sep 7, 2023

@hgy59 Help on this would be much appreciated considering the vast amount of python packages to publish...

@hgy59
Copy link
Contributor

hgy59 commented Sep 10, 2023

@th0ma7

After looking into build.sh, the following code must be omitted:

# publish to synocommunity.com when the API key is set
MAKE_ARGS=
if [ -n "$API_KEY" ] && [ "$PUBLISH" == "true" ]; then
    MAKE_ARGS="publish-"
fi

the publish prefix must be applied within the build loop:

# Build
PACKAGES_TO_KEEP="ffmpeg4 ffmpeg5 ffmpeg6"
for package in ${build_packages}
do

but only for the package to build

we can build all packages without publish- prefix and just after the line with make
add

if [ -n "$API_KEY" ] && [ "$PUBLISH" == "true" ] && [ "${package}" == "${PACKAGE_TO_PUBLISH}" ]; then
    make ...
fi

This must be implemented two times (once for noarch, and once for arch dependent packages)
So we need one additional variable PACKAGE_TO_PUBLISH only
this is just another env variable for the build job in build.yml

          PUBLISH: ${{ github.event.inputs.publish }}
          API_KEY: ${{ secrets.PUBLISH_API_KEY }}
          PACKAGE_TO_PUBLISH: ${{ github.event.inputs.package }}

BTW:
It is no problem to call make arch-... and make publish-arch-... for the same package
The second build (before the publish is executed) is very fast - it recreates the scripts, INFO and other files, but does not compile any thing again.

@hgy59
Copy link
Contributor

hgy59 commented Sep 10, 2023

addendum:

Perhaps it is better to keep the single make call (in case of build errors).
This could be done by the evaluation within the build loop:

# Build
PACKAGES_TO_KEEP="ffmpeg4 ffmpeg5 ffmpeg6"
for package in ${build_packages}
do
    echo "::group:: ---- build ${package}"
    echo >build.log
    if [ -n "$API_KEY" ] && [ "$PUBLISH" == "true" ] && [ "${package}" == "${PACKAGE_TO_PUBLISH}" ]; then
        MAKE_ARGS="publish-"
    else
        MAKE_ARGS=
    fi

and we can keep the rest of the loop as is....

@th0ma7
Copy link
Contributor Author

th0ma7 commented Sep 10, 2023

@hgy59 I did a variant on the theme #5876, thoughts?

@th0ma7 th0ma7 reopened this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants