From 5a2677d0bc9720d72f67bdd7e16cc5e44691e674 Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:32:14 +0530 Subject: [PATCH 1/8] Create aur.yml I have create aur.yml to auto update package to aur repo.Since the PKGBUILLD on Aur repo still has Mltiple error. following code will use ssh keys added to github secrets and update it. the followind code assumes the name of Key is AUR_SSH_PRIVATE_KEY --- .github/aur.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/aur.yml diff --git a/.github/aur.yml b/.github/aur.yml new file mode 100644 index 00000000..040bc794 --- /dev/null +++ b/.github/aur.yml @@ -0,0 +1,34 @@ +name: Publish to AUR + +on: + push: + tags: + - 'v*' # This will trigger the action for any tag that starts with 'v' + +jobs: + aur: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: sudo pacman -Syu --noconfirm git base-devel + + - name: Generate .SRCINFO + run: makepkg --printsrcinfo > .SRCINFO + + - name: Push to AUR + env: + AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + run: | + mkdir -p ~/.ssh + echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -t rsa aur.archlinux.org >> ~/.ssh/known_hosts + git clone ssh://aur@aur.archlinux.org/napture.git aur + cd aur + cp ../PKGBUILD ../.SRCINFO . + git add PKGBUILD .SRCINFO + git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" + git push From 74dd629d02da27916a7f3fa1e412507d4fbeb589 Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:41:16 +0530 Subject: [PATCH 2/8] Update aur.yml add auto generation of .SRCINFO --- .github/aur.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/aur.yml b/.github/aur.yml index 040bc794..24a13e89 100644 --- a/.github/aur.yml +++ b/.github/aur.yml @@ -12,23 +12,16 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Install dependencies - run: sudo pacman -Syu --noconfirm git base-devel - - - name: Generate .SRCINFO - run: makepkg --printsrcinfo > .SRCINFO - - - name: Push to AUR - env: - AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + - name: Install dependencies and update AUR run: | + sudo pacman -Syu --noconfirm git base-devel mkdir -p ~/.ssh - echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -t rsa aur.archlinux.org >> ~/.ssh/known_hosts - git clone ssh://aur@aur.archlinux.org/napture.git aur cd aur - cp ../PKGBUILD ../.SRCINFO . + cp ../PKGBUILD . + makepkg --printsrcinfo > .SRCINFO git add PKGBUILD .SRCINFO git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" git push From fa6215c3803c8d4293a4510483f30e04c366b596 Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:44:59 +0530 Subject: [PATCH 3/8] Update aur.yml --- .github/aur.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/aur.yml b/.github/aur.yml index 24a13e89..157c28cb 100644 --- a/.github/aur.yml +++ b/.github/aur.yml @@ -14,13 +14,14 @@ jobs: - name: Install dependencies and update AUR run: | - sudo pacman -Syu --noconfirm git base-devel + sudo pacman -S --noconfirm git base-devel mkdir -p ~/.ssh echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -t rsa aur.archlinux.org >> ~/.ssh/known_hosts - cd aur - cp ../PKGBUILD . + mkdir -p .github/aur # Create aur/ relative to the workflow file + cd .github/aur + cp ../../PKGBUILD . makepkg --printsrcinfo > .SRCINFO git add PKGBUILD .SRCINFO git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" From 50a9f806f3a7deaf6302c84de90e9b1c64492c73 Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:49:27 +0530 Subject: [PATCH 4/8] Update aur.yml --- .github/aur.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/aur.yml b/.github/aur.yml index 157c28cb..38e8cdb0 100644 --- a/.github/aur.yml +++ b/.github/aur.yml @@ -14,7 +14,7 @@ jobs: - name: Install dependencies and update AUR run: | - sudo pacman -S --noconfirm git base-devel + sudo apt install -y git build-essential mkdir -p ~/.ssh echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa From 4677dfe3c190a50f387ab4401fd9ff8d49abbe4c Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:24:04 +0530 Subject: [PATCH 5/8] Update aur.yml assuming ssh key are paswordless and have no pass to authenticate --- .github/aur.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/aur.yml b/.github/aur.yml index 38e8cdb0..ca5e229c 100644 --- a/.github/aur.yml +++ b/.github/aur.yml @@ -12,17 +12,29 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Install dependencies and update AUR + - name: Install dependencies + run: sudo apt install -y git build-essential + + - name: Configure SSH and clone AUR repository run: | - sudo apt install -y git build-essential mkdir -p ~/.ssh echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -t rsa aur.archlinux.org >> ~/.ssh/known_hosts - mkdir -p .github/aur # Create aur/ relative to the workflow file - cd .github/aur - cp ../../PKGBUILD . + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/id_rsa + git clone ssh://aur@aur.archlinux.org/napture.git napture + + - name: Copy PKGBUILD and generate .SRCINFO + run: | + cp PKGBUILD napture/ + cd napture makepkg --printsrcinfo > .SRCINFO + + - name: Commit and push changes to AUR + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" git add PKGBUILD .SRCINFO git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" git push From 2af4d7b655fc7d9abafdb51603d61b95143aad0d Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:26:08 +0530 Subject: [PATCH 6/8] Update aur.yml --- .github/aur.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/aur.yml b/.github/aur.yml index ca5e229c..0bb5b2d5 100644 --- a/.github/aur.yml +++ b/.github/aur.yml @@ -33,8 +33,6 @@ jobs: - name: Commit and push changes to AUR run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" git add PKGBUILD .SRCINFO git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" git push From 23a20b903049b710408120e09029d28cc9795a8f Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:30:24 +0530 Subject: [PATCH 7/8] Rename .github/aur.yml to .github/workflows/aur.yml --- .github/{ => workflows}/aur.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/aur.yml (100%) diff --git a/.github/aur.yml b/.github/workflows/aur.yml similarity index 100% rename from .github/aur.yml rename to .github/workflows/aur.yml From c6a86b413ea78e70d2ac52aa789c5799c5b7a1db Mon Sep 17 00:00:00 2001 From: Jenil <78353041+jenil1122@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:33:46 +0530 Subject: [PATCH 8/8] Update aur.yml --- .github/workflows/aur.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml index 0bb5b2d5..8504ea2d 100644 --- a/.github/workflows/aur.yml +++ b/.github/workflows/aur.yml @@ -20,7 +20,6 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa - ssh-keyscan -t rsa aur.archlinux.org >> ~/.ssh/known_hosts eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa git clone ssh://aur@aur.archlinux.org/napture.git napture