Giter Site home page Giter Site logo

ksxgithub / github-actions-deploy-aur Goto Github PK

View Code? Open in Web Editor NEW
102.0 3.0 12.0 69 KB

GitHub Actions to publish AUR package

Home Page: https://github.com/marketplace/actions/publish-aur-package

License: MIT License

Dockerfile 8.66% Shell 91.34%
actions aur archlinux ci publishing delivery

github-actions-deploy-aur's Introduction

Publish AUR package

GitHub Actions to publish AUR package.

Inputs

pkgname

Required AUR package name.

pkgbuild

Required Path to PKGBUILD file. This file is often generated by prior steps.

assets

Optional Newline-separated glob patterns for additional files to be added to the AUR repository. Glob patterns will be expanded by bash when copying the files to the repository.

updpkgsums

Optional Update checksums using updpkgsums.

test

Optional Check that PKGBUILD could be built.

test_flags

Optional Command line flags for makepkg to build the package (if test is enabled). The default flags are --clean --cleanbuild --nodeps.

post_process

Optional A line of commands to execute after processing the package.

commit_username

Required The username to use when creating the new commit.

commit_email

Required The email to use when creating the new commit.

ssh_private_key

Required Your private key with access to AUR package.

commit_message

Optional Commit message to use when creating the new commit.

allow_empty_commits

Optional Allow empty commits, i.e. commits with no change. The default value is true.

force_push

Optional Use --force when push to the AUR. The default value is false.

ssh_keyscan_types

Optional Comma-separated list of types to use when adding aur.archlinux.org to known hosts.

Example usage

name: aur-publish

on:
  push:
    tags:
      - '*'

jobs:
  aur-publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Publish AUR package
        uses: KSXGitHub/github-actions-deploy-aur@<TAG>
        with:
          pkgname: my-awesome-package
          pkgbuild: ./PKGBUILD
          commit_username: ${{ secrets.AUR_USERNAME }}
          commit_email: ${{ secrets.AUR_EMAIL }}
          ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
          commit_message: Update AUR package
          ssh_keyscan_types: rsa,dsa,ecdsa,ed25519

Note: Replace <TAG> in the above code snippet with a tag of this repo.

Tip: To create secrets (such as secrets.AUR_USERNAME, secrets.AUR_EMAIL, and secrets.AUR_SSH_PRIVATE_KEY above), go to $YOUR_GITHUB_REPO_URL/settings/secrets. Read this for more information.

Tip: This action does not generate PKGBUILD for you, you must generate it yourself (e.g. by using actions before this action).

Real-world applications

sane-fmt has a workflow that builds and uploads executables to GitHub Release then generates PKGBUILD files for and use this very action to update aur/sane-fmt and aur/sane-fmt-bin.

pretty-exec has a workflow that builds and uploads executables to GitHub Release then generates PKGBUILD files for and use this very action to update aur/pretty-exec and aur/pretty-exec-bin.

build-fs-tree has a workflow that builds and uploads executables to GitHub Release then generates PKGBUILD files for and use this very action to update aur/build-fs-tree and aur/build-fs-tree-bin.

strip-ansi-cli has a workflow that builds and uploads executables to GitHub Release then generates PKGBUILD files for and use this very action to update aur/strip-ansi and aur/strip-ansi-bin.

parallel-disk-usage has a workflow that builds and uploads executables to GitHub Release then generates PKGBUILD files for and use this very action to update aur/parallel-disk-usage and aur/parallel-disk-usage-bin.

Become a Patron

My Patreon Page.

License

MIT © Hoàng Văn Khải

github-actions-deploy-aur's People

Contributors

filips123 avatar fuljo avatar ksxgithub avatar ouuan avatar rgeraskin avatar susurri avatar thyrum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

github-actions-deploy-aur's Issues

Handle AUR dependencies during test

I have an AUR package that depends on another AUR package for building. Is it possible to somehow specify to install that before attempting to build it?

Would it make sense to automatically install all specified dependencies?

Dependabot couldn't find a <anything>.yml for this project

Dependabot couldn't find a .yml for this project.

Dependabot requires a .yml to evaluate your project's current Github_actions dependencies. It had expected to find one at the path: /.github/workflows/<anything>.yml.

If this isn't a Github_actions project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

src refspec master does not match any

Hi

Help!I don't know why, I suddenly can't push to aur today

  add '.SRCINFO'
  add 'PKGBUILD'
  [detached HEAD 754f343] Update AUR package
   2 files changed, 2 insertions(+), 2 deletions(-)

  Pushing to ssh://aur.archlinux.org/earth-wallpaper-git.git
  error: src refspec master does not match any
  error: failed to push some refs to 'ssh://aur.archlinux.org/earth-wallpaper-git.git'

Is there any solution?

Thanks!

[email protected]: Permission denied (publickey)

I generated the ssh keys with ssh-keygen and ended up with 2 files, aur and aur.pub. I copied the content of aur.pub into my profile on the aur's website, and the content of aur into the github secrets. If I try to push from my local machine, no error happens, but from the github action, I get this output :

  Getting AUR SSH Public keys
  # aur.archlinux.org:22 SSH-2.0-OpenSSH_9.3
  # aur.archlinux.org:22 SSH-2.0-OpenSSH_9.3
  # aur.archlinux.org:22 SSH-2.0-OpenSSH_9.3
  # aur.archlinux.org:22 SSH-2.0-OpenSSH_9.3
  # aur.archlinux.org:22 SSH-2.0-OpenSSH_9.3
  Writing SSH Private keys to file
  Setting up Git
  Cloning repo
  Cloning into 'hatt-bin'...
  Load key "/home/builder/.ssh/aur": error in libcrypto
  [email protected]: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.

I'm not sure what I am doing wrong

Dependabot couldn't find a <anything>.yml for this project

Dependabot couldn't find a .yml for this project.

Dependabot requires a .yml to evaluate your project's current Github_actions dependencies. It had expected to find one at the path: /.github/workflows/<anything>.yml.

If this isn't a Github_actions project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.

Detected dependencies

dockerfile
Dockerfile
  • archlinux base

  • Check this box to trigger a request for Renovate to run again on this repository

Automatically copy all local `source` files

Currently, one has to duplicate all local files that are included in the package as part of assets. However, the action already knows which files should be present: It is specified in the source array.

PKGBUILD files are valid shell scripts. Wouldn't it make more sense to do source PKGBUILD and then iterate over source and copy everything that doesn't start with http://?

Support pushing other files to AUR repository

I would like to publish other files (for example, .gitignore, .install script, patches, other assets...) to the AUR repository along with the PKGBUILD and .SRCINFO. I think this could be done by adding another input to the action (maybe assets) that accepts a list of files (maybe also whole directories or glob patterns), copies them to /tmp/local-repo and commits them along with existing files.

Error in arch container build

Hi, today when run the github action I get the following error:

Step 3/7 : RUN pacman -S --noconfirm --needed --overwrite '*'       openssh sudo       git fakeroot binutils gcc awk binutils xz       libarchive bzip2 coreutils file findutils       gettext grep gzip sed ncurses util-linux
   ---> Running in e7f53f4dd7e9
  error: failed to initialize alpm library
  (could not find or read directory: /var/lib/pacman/)
  The command '/bin/sh -c pacman -S --noconfirm --needed --overwrite '*'       openssh sudo       git fakeroot binutils gcc awk binutils xz       libarchive bzip2 coreutils file findutils       gettext grep gzip sed ncurses util-linux' returned a non-zero code: 255

Screenshot_20210209_083616

I found this https://www.reddit.com/r/archlinux/comments/lek2ba/arch_linux_on_docker_ci_could_not_find_or_read/gmg4foj?utm_source=share&utm_medium=web2x&context=3 maybe help.

Pull access denied for archlinux/base

Hi, faced with some problems trying to publish the AUR package. The same GH Workflows worked fine a few weeks ago.

Workflow:

name: publish-aur

on:
  push:
    tags:
      - '*'

jobs:
  aur-publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Publish AUR package
        uses: KSXGitHub/[email protected]
        with:
          pkgname: crowdin-cli
          pkgbuild: ./pkgbuild/PKGBUILD
          commit_username: ${{ secrets.AUR_USERNAME }}
          commit_email: ${{ secrets.AUR_EMAIL }}
          ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
          commit_message: Update AUR package
          ssh_keyscan_types: rsa,dsa,ecdsa,ed25519

Action logs:

2021-04-30T08:32:29.8974463Z Prepare workflow directory
2021-04-30T08:32:29.9662482Z Prepare all required actions
2021-04-30T08:32:29.9677289Z Getting action download info
2021-04-30T08:32:30.4233881Z Download action repository 'actions/checkout@v2'
2021-04-30T08:32:32.2525357Z Download action repository 'KSXGitHub/[email protected]'
2021-04-30T08:32:32.7895932Z ##[group]Build container for action use: '/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3/Dockerfile'.
2021-04-30T08:32:32.7980113Z ##[command]/usr/bin/docker build -t 8a33c1:d4a793bdb67741cabac3a7c3694369c7 -f "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3/Dockerfile" "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3"
2021-04-30T08:32:33.0699625Z Sending build context to Docker daemon  17.92kB
2021-04-30T08:32:33.0705274Z 
2021-04-30T08:32:33.1271431Z Step 1/7 : FROM archlinux/base
2021-04-30T08:32:34.4111151Z pull access denied for archlinux/base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
2021-04-30T08:32:34.4132457Z ##[warning]Docker build failed with exit code 1, back off 4.587 seconds before retry.
2021-04-30T08:32:39.0035055Z ##[command]/usr/bin/docker build -t 8a33c1:d4a793bdb67741cabac3a7c3694369c7 -f "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3/Dockerfile" "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3"
2021-04-30T08:32:39.0509679Z Sending build context to Docker daemon  17.92kB
2021-04-30T08:32:39.0519804Z 
2021-04-30T08:32:39.1092820Z Step 1/7 : FROM archlinux/base
2021-04-30T08:32:40.3475306Z pull access denied for archlinux/base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
2021-04-30T08:32:40.3507723Z ##[warning]Docker build failed with exit code 1, back off 6.581 seconds before retry.
2021-04-30T08:32:46.9355422Z ##[command]/usr/bin/docker build -t 8a33c1:d4a793bdb67741cabac3a7c3694369c7 -f "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3/Dockerfile" "/home/runner/work/_actions/KSXGitHub/github-actions-deploy-aur/v2.2.3"
2021-04-30T08:32:46.9870657Z Sending build context to Docker daemon  17.92kB
2021-04-30T08:32:46.9878502Z 
2021-04-30T08:32:47.0477518Z Step 1/7 : FROM archlinux/base
2021-04-30T08:32:48.2820201Z pull access denied for archlinux/base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
2021-04-30T08:32:48.2830749Z ##[endgroup]
2021-04-30T08:32:48.2952499Z ##[error]Docker build failed with exit code 1
2021-04-30T08:32:48.3009219Z Cleaning up orphan processes

Could you please suggest the possible reason of this problem?

`GLIBC_2.33' not found

Hi @KSXGitHub.

I'm trying to publish my PKGBUILD to AUR using the action you created.

Unfortunately Github CI is aborting the job stating:

Run KSXGitHub/github-actions-deploy-aur@v2
  with:
    pkgname: sleek
    pkgbuild: ./PKGBUILD
    commit_username: ***
    commit_email: ***
    ssh_private_key: ***
    commit_message: Update to latest sleek release
    ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
/usr/bin/docker run --name e409800e00edda48ba857a1a2263fe1ec2_4928f2 --label 5588e4 --workdir /github/workspace --rm -e INPUT_PKGNAME -e INPUT_PKGBUILD -e INPUT_COMMIT_USERNAME -e INPUT_COMMIT_EMAIL -e INPUT_SSH_PRIVATE_KEY -e INPUT_COMMIT_MESSAGE -e INPUT_SSH_KEYSCAN_TYPES -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/sleek/sleek":"/github/workspace" 5588e4:09800e00edda48ba857a1a2263fe1ec2
Creating builder user...
passwd: password expiry information changed.
Initializing ssh directory...
mkdir: created directory '/home/builder/.ssh'
'/ssh_config' -> '/home/builder/.ssh/config'
ownership of '/home/builder/.bash_logout' retained as builder:builder
changed ownership of '/home/builder/.ssh/known_hosts' from root:root to builder:builder
changed ownership of '/home/builder/.ssh/config' from root:root to builder:builder
changed ownership of '/home/builder/.ssh' from root:root to builder:builder
ownership of '/home/builder/.bash_profile' retained as builder:builder
ownership of '/home/builder/.bashrc' retained as builder:builder
ownership of '/home/builder' retained as builder:builder
mode of '/home/builder/.ssh/config' changed from 0644 (rw-r--r--) to 0600 (rw-------)
mode of '/home/builder/.ssh/known_hosts' changed from 0644 (rw-r--r--) to 0600 (rw-------)
Copying PKGBUILD...
Running build.sh...
runuser: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by runuser)

Do you have any idea how I could solve this?

This is the job's part in my yml:

  publish-aur-package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Publish AUR package
        uses: KSXGitHub/github-actions-deploy-aur@v2
        with:
          pkgname: sleek
          pkgbuild: ./PKGBUILD
          commit_username: ${{ secrets.AUR_USERNAME }}
          commit_email: ${{ secrets.AUR_EMAIL }}
          ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
          commit_message: Update to latest sleek release

Best

Error SSHKEY

Hello, i have an error during actions of your script :

Load key "/home/builder/.ssh/aur": invalid format
Importing private key
mode of '/home/builder/.ssh/aur' changed from 0644 (rw-r--r--) to 0600 (rw-------)

after that, the actions is stoped

Overwrite AUR-repo's working directory instead of copying individual files

Description

To fully manage the contents of the AUR repository, a rewriting approach is
needed, which affects the working folder as 1:1. Does it make any sense to use
copying files instead of overwriting the entire working folder?

Use case

The need to delete a file from the AUR repository. Now it is only possible to
overwrite the file in the repository when copying, with or without assets, but
you cannot delete file. Even if I duplicate file in the GitHub repository first,
and then delete it, will it remain in the AUR? This is very unobvious.

failed to push some refs

Hi,

Recently, several projects using this GH Action to push AUR packages are failing:

  add '.SRCINFO'
  add 'PKGBUILD'
  [master 51e44ab] Update AUR package
   2 files changed, 5 insertions(+), 5 deletions(-)
  Pushing to ssh://aur.archlinux.org/helm-freeze.git
  Warning: Permanently added the ECDSA host key for IP address '95.216.144.15' to the list of known hosts.
  To ssh://aur.archlinux.org/helm-freeze.git
   ! [rejected]        master -> master (stale info)
  error: failed to push some refs to 'ssh://aur.archlinux.org/helm-freeze.git'

Always the same issue and I didn't change anything on my side (SSH keys are the same and it works if I do it manually with those ssh keys).

Any idea?

Thx

Dependabot couldn't find a <anything>.yml for this project

Dependabot couldn't find a .yml for this project.

Dependabot requires a .yml to evaluate your project's current Github_actions dependencies. It had expected to find one at the path: /.github/workflows/<anything>.yml.

If this isn't a Github_actions project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

no assets input?

According to the documentation there is an assets input, but when I use it I get the warning:

Warning: Unexpected input(s) 'assets', valid inputs are ['entryPoint', 'args', 'pkgname', 'pkgbuild', 'commit_username', 'commit_email', 'ssh_private_key', 'commit_message', 'allow_empty_commits', 'force_push', 'ssh_keyscan_types']

In the following log however the input shows up:

Run KSXGitHub/[email protected]
  with:
    pkgname: mailctl-bin
    pkgbuild: ./aur/PKGBUILD
    assets: ./aur/.INSTALL

The end result was the update on assets (.INSTALL) never made it to the AUR repo.

Source files

When in the repository has source files in the root next to PKGBUILD, just the PKGBUILD is copied, and then makepkg fail.

image

Automatically generate source sums

Can you add support for automatically adding source sums to PKGBUILD? I think this can be done by installing updpkgsums and then just running it before creating .SRCINFO in the PKGBUILD directory. This will automatically download all sources and put their sums into PKGBUILD.

Error

Hello, I have an error :

error: src refspec master does not match any
error: failed to push some refs to 'ssh://aur.archlinux.org/tess-git.git'

invalid key format

Same issue as #17

https://github.com/SunshineStream/Sunshine/runs/6951924698?check_suite_focus=true#step:6:70

Importing private key
  mode of '/home/builder/.ssh/aur' changed from 0644 (rw-r--r--) to 0600 (rw-------)
  Load key "/home/builder/.ssh/aur": invalid format

AUR account - SSH Public Key:

ssh-rsa A...=

doesn't have any extra lines

github secrets - AUR_SSH_PRIVATE_KEY

b...
...
...
...
==

doesn't have any extra lines

I generated my key following these commands (https://phoenixnap.com/kb/generate-setup-ssh-key-ubuntu):

mkdir -p $HOME/.ssh
chmod 0700 $HOME/.ssh
ssh-keygen

public key came from aur.pub file
private key came from aur file

workflow step: https://github.com/SunshineStream/Sunshine/actions/runs/2522361975/workflow#L77

Maybe I did something wrong generating the key or adding it to my aur profile?

.SRCINFO publishing

Hi, thanks for the great GH action!

I have a question regarding package version publishing.

Due to AUR submission guidelines, there is a requirement to update .SRCINFO file along with PKGBUILD.

Be sure to regenerate .SRCINFO whenever PKGBUILD metadata changes, such as pkgver() updates; otherwise the AUR will not show updated version numbers.

But I don't see any options in this action allowing to publish the .SRCINFO also. How to deal with this requirement using this GH action?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.