JamieMagee / aur-packages-template

Maintain your AUR packages automatically using Renovate
MIT License
6 stars 0 forks source link

Help with template #27

Closed D4llo closed 9 months ago

D4llo commented 9 months ago

Hello,

I am trying to submit a package to the AUR with this template. Here is my repository https://github.com/D4llo/surfshark-yac/

Both GH actions fail. I think that I missed something but I am not sure what. Do you have any idea?

Publish action: https://github.com/D4llo/surfshark-yac/actions/runs/7702075403

image

I tested my passpharse locally with ssh-keygen -y -P "<my_passphrase>" -f ~/.ssh/id_ed25519 and it works as expected

Updpkgsums action: https://github.com/D4llo/surfshark-yac/actions/workflows/updpkgsums.yml

image

Note that this my first time submitting something to the AUR.

My pub key is on my AUR account: image

My passphrase, my login and my mail are set as Repository secrets

image

(maybe it should be Environment secrets?)

Cheers,

source:

JamieMagee commented 9 months ago

Yeah, you need to use an SSH private key without a passphrase. Otherwise GitHub Actions is not able to unlock it.

Everything else looks correct.

D4llo commented 9 months ago

Alright I am going to try that. Thanks a lot for your work and the quick comment!

D4llo commented 9 months ago

It worked. kinda. I have a new issue later on. Should I keep posting over here or should I create a new issue?

This is about this action https://github.com/D4llo/surfshark-yac/actions/runs/7716321502/job/21032834330

image

Edit: I think I got it. Still working on it

JamieMagee commented 9 months ago

This issue is fine.

What's the new problem?

D4llo commented 9 months ago

I dont think that it is related to the template. I am not sure.

I am trying to push an AUR package based on a deb package. The script is looking to download the deb file through curl but failed.

I can wget the .deb in local

image

Here is the log of the GitHub Actions

image

link: https://github.com/D4llo/surfshark-yac/actions/runs/7717047680/job/21035250047

There is another issue about the missing pacman-key --init. Could it be related?

D4llo commented 9 months ago

Just saw that the url path seems to have change. Let's remove the subpath /surfshark/

Edit: OH BOY https://github.com/D4llo/surfshark-yac/actions/runs/7718706385/job/21040539081?pr=7

Edit 2: Ok the publish just started https://github.com/D4llo/surfshark-yac/actions/runs/7718728168/job/21040599267

Edit 3: and it failed ==> ERROR: install file (surfshark-yac.install) does not exist or is not a regular file. Let's dig. https://github.com/D4llo/surfshark-yac/actions/runs/7718728168/job/21040599267#step:5:83

Cloning AUR package into /tmp/local-repo
  Cloning into '/tmp/local-repo'...
  POST git-upload-pack (175 bytes)
  warning: You appear to have cloned an empty repository.

Why this repository is empty? Should I init it in some way? Maybe in the AUR side?

D4llo commented 9 months ago

What is a regular file? Because indeed the surfshark-yac.install is not a common file. Maybe we are expected a specific name or something like that. How to include it properly?

D4llo commented 9 months ago

Ok I am digging the "not included" idea. Let's follow this line:

https://github.com/D4llo/surfshark-yac/blob/918711c841add120fed9fff990fc8f5e12c22347/.github/workflows/updpkgsums.yml#L39

- name: Commit
        if: ${{ env.pkgbuild != '' }}
        uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
        with:
          file_pattern: '*/PKGBUILD */.SRCINFO'

I think that I should edit the file_pattern to include everything or add a argument for my file.

Edit: as per the stefanzweifel/git-auto-commit-action's documentation. It should work.

`file_pattern` is used both for `git-status` and `git-add` in this Action. `git-add` will throw a fatal error, if for example, you use a file pattern like `*.js *.ts` but no `*.ts` files exist in your projects' repository.
D4llo commented 9 months ago

Failed again image

But I think I am on something

Edit: nevermind it is "*/" and not "./" LMAO

D4llo commented 9 months ago

Still failing... image

https://github.com/D4llo/surfshark-yac/actions/runs/7725179403/job/21058847363#step:5:92

FYI this is the pattern now image

I am a bit puzzled...

JamieMagee commented 9 months ago

I think it's because it's looking for surfshark-yac.install in the root of the directory, but it's in the surfshark-yac sub-directory. Can you try set working-directory for that step?

D4llo commented 9 months ago

Not sure how to do that. Should I do this in .github/workflows/publish.yml?

   - name: Publish package
        working-directory: ./surfshark-yac
        uses: KSXGitHub/github-actions-deploy-aur@063daf78a56662642bb00049ce78425ff6d0fad7 # v2.7.0
        if: ${{ env.pkgbuild != '' }}
        with:
          pkgname: ${{ env.pkgbuild }}
          pkgbuild: ${{ env.pkgbuild }}/PKGBUILD
          commit_username: ${{ secrets.AUR_USERNAME }}
          commit_email: ${{ secrets.AUR_EMAIL }}
          ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

or during the packaging in updpkgsums.yml?

      - name: Commit
        working-directory: ./surfshark-yac
        if: ${{ env.pkgbuild != '' }}
        uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0
        with:
          file_pattern: '*/PKGBUILD */.SRCINFO */surfshark-yac.install */.gitignore'

https://github.com/D4llo/surfshark-yac/blob/35782c6114fdbf212dac4cc008f9641a9260f419/.github/workflows/publish.yml#L26

https://github.com/D4llo/surfshark-yac/blob/35782c6114fdbf212dac4cc008f9641a9260f419/.github/workflows/updpkgsums.yml#L35C1-L39C85

D4llo commented 9 months ago

Well it is not that image

D4llo commented 9 months ago

Just saw that in the project gp-saml-gui your adding an extra .sh with source like this?

image

Should I add my .install like this?

As per the doc I shouldn't:

.install files are recognized automatically by makepkg and should not be included in the source array.

https://wiki.archlinux.org/title/PKGBUILD#source

D4llo commented 9 months ago

The project gnome-shell-extension-emoji-selector-git uses a .install file like this install = gnome-shell-extension.install. I guess that the usage of a hard-coded name is to alias and remove the "emoji-selector-git" section.

Is there any other reason that my project could benefit from?

By the way why did I had to have the following file_pattern to include my .install when gnome-shell-extension uses the regular file_pattern from the template without trouble.

file_pattern: '*/PKGBUILD */.SRCINFO */surfshark-yac.install */.gitignore'

Did I miss anything?

JamieMagee commented 9 months ago

Yeah, can you copy gnome-shell-extension-emoji-selector-git as an example and see if it works for you?

D4llo commented 9 months ago

The diff can be seen here: https://github.com/D4llo/surfshark-yac/pull/13/files?diff=split&w=1

Not sure what to do from here

 remote: Permission to D4llo/surfshark-yac.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/D4llo/surfshark-yac/': The requested URL returned error: 403
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/8756aa072ef5b4a080af5dc8fef36c5d586e521d/index.js:17:19)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: 128
}
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/8756aa072ef5b4a080af5dc8fef36c5d586e521d/index.js:17:19)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
JamieMagee commented 9 months ago

That error is because it's in the wrong directory. The build script expects the directory to be the same name as the package.

D4llo commented 9 months ago

Alright make sense

Action https://github.com/D4llo/surfshark-yac/actions/runs/7826796877/job/21353319753

D4llo commented 9 months ago

After searching for the error online I edited some permissions

image

https://stackoverflow.com/a/75308228/1248177

To avoid this manual steps we could add the following permission to the workflow file

permissions:
  contents: write
D4llo commented 9 months ago

Should I merge to try to publish? https://github.com/D4llo/surfshark-yac/pull/13

D4llo commented 9 months ago

It is working image

JamieMagee commented 9 months ago

Excellent! I'm glad it's working.

D4llo commented 9 months ago

Now I have to make my own package works.

D4llo commented 9 months ago

Still the same issue

image

JamieMagee commented 9 months ago

Try add assets: ${{ env.pkgbuild }}/* to the with of the Publish package step

diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ff693a8..f074aab 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -29,6 +29,7 @@ jobs:
         with:
           pkgname: ${{ env.pkgbuild }}
           pkgbuild: ${{ env.pkgbuild }}/PKGBUILD
+          assets: ${{ env.pkgbuild }}/*
           commit_username: ${{ secrets.AUR_USERNAME }}
           commit_email: ${{ secrets.AUR_EMAIL }}
           ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
D4llo commented 9 months ago

It works!!!!!!!!!

https://aur.archlinux.org/packages/surfshark-yac

image

JamieMagee commented 9 months ago

Excellent!