arch4edu / aur-auto-update

Automatically update PKGBUILDs on AUR
23 stars 8 forks source link

how to implement this ? #41

Open feydreva opened 4 months ago

feydreva commented 4 months ago

Hello, I am really interested in this. I maintain an AUR package. I got nvcheker working, so I get a notification when a new version is there. But I need to manually update the PKGBUILD and manually git push to aur.

I would love to have a bot doing version update automatically, but reading this, I don't understand how to implement it. Could you guide me with more instruction ?

Thank you

carlosal1015 commented 4 months ago

Nice @feydreva , first step is add as comaintaner the user AutoUpdateBot like this image

Then, submit a pull request and create a file over config/feydreva/<package-name>.yaml for example, here you can share your nvchecker entry to help to modify. For example

nvchecker:
  gitlab: libxc/libxc
  source: gitlab
  use_max_tag: true
test: true
feydreva commented 4 months ago

Hello, So after some effort, lots of reading about git and how it works, I made a pull request. please be kind :) if there is any mistake or other things I need to do, let me know ! Thank you for your help and patience

carlosal1015 commented 3 months ago

Thanks, let's run the pipeline for the PR #42

feydreva commented 3 months ago

Hello, Autobot doesn't seem to update the package with new version. Is there anything I have to do ? how can I verify this ? Thank you

carlosal1015 commented 3 months ago

True, winamax-bin.yaml needs python-lxml in order to support for htmlparser. Many nvchecker configs here using regex like this

nvchecker:
  regex: pkgname-([\d.]+).tar.gz
  source: regex
  url: https://www.example.com
pkgver: get-pkgver
test:
  enable: true

We can switch to regex instead of xml parser.

petronny commented 3 months ago

Autobot doesn't seem to update the package with new version.

https://github.com/arch4edu/aur-auto-update/actions/runs/8306337444/job/22734274209

 ModuleNotFoundError: No module named 'typing_extensions'
Error: Process completed with exit code 1.

This workflow is failing. Fixing now.

petronny commented 3 months ago

In https://github.com/arch4edu/aur-auto-update/actions/runs/8308392492/job/22738576498

 [I 03-16 14:21:15.467 core:374] winamax-bin: updated to 0;url=https://dl.winamax.fr/client/electron/linux/all/winamax-1.53.0.deb
No action is configured for winamax-bin.

Please check the parsed version. When the version is correct, please set test: true to enable the build test.

feydreva commented 3 months ago

hmm trying to make a new config file, but do not succeed to make it work :/ This only place I see the name of the file is in the source code of the page :

regex doesn't seem to work here

carlosal1015 commented 3 months ago

No worries, if you have some progress, we could take a look.

petronny commented 1 month ago

There is another problem. The page is hosted on cloudfront and could not be accessed from some country/region. So it may return 403 sometime in GitHub Actions.

This only place I see the name of the file is in the source code of the page : regex doesn't seem to work here

regex will work here.

nvchecker:
  source: "regex"
  url: "https://www.winamax.fr/jouer-au-poker?dl=1&platform=linux"
  regex: 'winamax-([\d.]+).deb'
petronny commented 1 month ago

There is another problem. The page is hosted on cloudfront and could not be accessed from some country/region. So it may return 403 sometime in GitHub Actions.

A workaround could be creating a proxy to access the content. The following is an example to do it with Cloudflare Worker (generated by GPT). You can also try other cloud function services.

export default {
  async fetch(request, env, ctx) {
    const url = "https://www.winamax.fr/jouer-au-poker?dl=1&platform=linux";
    const regex = /winamax-([\d.]+).deb/;

    try {
      const response = await fetch(url);
      const text = await response.text();
      const match = text.match(regex);

      if (match && match[1]) {
        return new Response(match[1]);
      } else {
        return new Response("No match found");
      }
    } catch (error) {
      return new Response("Error: " + error);
    }
  },
};