diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml new file mode 100644 index 00000000..8504ea2d --- /dev/null +++ b/.github/workflows/aur.yml @@ -0,0 +1,37 @@ +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 apt install -y git build-essential + + - name: Configure SSH and clone AUR repository + run: | + mkdir -p ~/.ssh + echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + 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 add PKGBUILD .SRCINFO + git commit -m "Update PKGBUILD for version ${{ github.event.release.tag_name }}" + git push