You are not logged in.

#1 2021-04-28 06:26:45

ioquatix
Member
Registered: 2014-03-30
Posts: 18

How to handle packages in which the source root has sub-directories?

I am maintaining github-actions-bin and we are attempting to automate this package update using GitHub Actions. But it requires a .github sub-directory. Because of this, we cannot push it.

https://github.com/ioquatix/github-actions-bin

When we try to push the automatically generated update:

Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 8 threads
Compressing objects: 100% (17/17), done.
Writing objects: 100% (21/21), 4.65 KiB | 2.32 MiB/s, done.
Total 21 (delta 11), reused 0 (delta 0), pack-reused 0
remote: Checking connectivity: 21, done.
remote: error: The following error occurred when parsing commit
remote: error: d89ba824e3bfd64f8d12e86857da42c372498712:
remote: error: the repository must not contain subdirectories
remote: error: hook declined to update refs/heads/master
To ssh://aur.archlinux.org/github-actions-bin.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur.archlinux.org/github-actions-bin.git'

Would it make sense to relax this requirement so we can have a consistent master branch? Or is there some other way we can solve this issue?

Thanks!

Offline

#2 2021-04-28 07:22:08

Awebb
Member
Registered: 2010-05-06
Posts: 6,602

Re: How to handle packages in which the source root has sub-directories?

I don't see any reference to this .github directory. It only has one file. Can't you put the file in the root folder of the repository and generate the .github folder in the PKGBUILD?

Offline

#3 2021-04-28 07:29:17

ioquatix
Member
Registered: 2014-03-30
Posts: 18

Re: How to handle packages in which the source root has sub-directories?

GitHub Actions needs the file to be in a specific place, i.e. in `.github/workflows`. It also AFAIK needs to be on the master branch. It's not needed by pacman, but it's needed by GitHub which runs essentially a cron job to check the latest release, and commit an update to the package. The next step is for GitHub Actions to push he package to AUR automatically.

Offline

#4 2021-04-28 07:33:26

progandy
Member
Registered: 2012-05-17
Posts: 5,263

Re: How to handle packages in which the source root has sub-directories?

ioquatix wants to automatically push the repository to the AUR when it is changed on github using the github actions. To enable github actions, its configuration must be in the .github directory. It would be possible to filter the branch, but then the commit ids would be different between the github and aur repositories.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#5 2021-04-28 07:33:54

Awebb
Member
Registered: 2010-05-06
Posts: 6,602

Re: How to handle packages in which the source root has sub-directories?

progandy wrote:

ioquatix wants to automatically push the repository to the AUR when it is changed on github using the github actions. To enable github actions, its configuration must be in the .github directory. It would be possible to filter the branch, but then the commit ids would be different between the github and aur repositories.

Oh, I see.

Last edited by Awebb (2021-04-28 07:34:51)

Offline

#6 2021-04-28 09:40:37

a821
Member
Registered: 2012-10-31
Posts: 381

Re: How to handle packages in which the source root has sub-directories?

Subfolders in the AUR git repos are not supported... AFAIR from past discussions in this forum, but wait for a dev/TU to comment.

Offline

#7 2021-04-28 11:19:39

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to handle packages in which the source root has sub-directories?

ioquatix wrote:

Or is there some other way we can solve this issue?

You could try using the "aurpublish" package and storing the PKGBUILD in a subdirectory too. aurpublish will use git subtrees to split out one subdirectory as a new repo and push it to the AUR -- the AUR won't contain any files in github, other than the ones in the per-package subdirectory.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2021-04-29 00:00:34

ioquatix
Member
Registered: 2014-03-30
Posts: 18

Re: How to handle packages in which the source root has sub-directories?

> You could try using the "aurpublish" package and storing the PKGBUILD in a subdirectory too. aurpublish will use git subtrees to split out one subdirectory as a new repo and push it to the AUR -- the AUR won't contain any files in github, other than the ones in the per-package subdirectory.

It sounds tricky to automate from GH Actions. But I will explore it as an option. I understand the desire to keep AUR simple. It doesn't really make sense that it should receive GH configuration files. I'm just at a bit of a loss as to how I can do this and keep it simple for everyone (maintainers, etc). For a lot of software, it's very similar: A GH repo with automatic hooks which tests the updated package, push to AUR on success. I would like to use this more going forward if possible.

Offline

#9 2021-04-29 00:06:13

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to handle packages in which the source root has sub-directories?

Other options include:

  • cloning the AUR repo, copying over the PKGBUILD + .SRCINFO, and committing / pushing

  • implementing the actual upload part of aurpublish yourself without minor safety rails:

    git subtree push -P "${package}" aur@aur.archlinux.org:${pkgbase}.git master

Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2021-04-29 00:23:47

ioquatix
Member
Registered: 2014-03-30
Posts: 18

Re: How to handle packages in which the source root has sub-directories?

Ah those are good options to consider, thanks.

Offline

#11 2021-04-29 01:52:59

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to handle packages in which the source root has sub-directories?

The aurpublish script is pretty simple to use on its own FWIW, you don't need to install it via an Arch package in your GH Actions -- just clone https://github.com/eli-schwartz/aurpublish/ and run it.

But you could also trivially hardcode the names of the packages you're uploading, so YMMV.

...

If you do the copying-PKGBUILD-over-and-pushing then syncing commit messages/history becomes quite awkward, this is one of the advantages of aurpublish -- since it uses git-subtree, the commit history of the directory containing the PKGBUILD is preserved.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB