diff --git a/.github/workflows/distribute-archlinux.yml b/.github/workflows/distribute-archlinux.yml new file mode 100644 index 00000000..b055565c --- /dev/null +++ b/.github/workflows/distribute-archlinux.yml @@ -0,0 +1,39 @@ +name: Distribute for Arch Linux + +on: + workflow_dispatch: + workflow_run: + workflows: ['Release'] + types: + - completed + +jobs: + aur: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Update PKGBUILD for AUR + run: | + sed -i 's/pkgname=flood/pkgname=nodejs-flood/' ./distribution/archlinux/flood/PKGBUILD + sed -i 's/replace-with-your-name/Jesse Chan/' ./distribution/archlinux/flood/PKGBUILD + sed -i 's/to-be-determined@tbd/jc@linux.com/' ./distribution/archlinux/flood/PKGBUILD + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Publish to AUR + uses: docker/build-push-action@v2 + with: + build-args: | + AUR_FINGERPRINT="aur.archlinux.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLMiLrP8pVi5BFX2i3vepSUnpedeiewE5XptnUnau+ZoeUOPkpoCgZZuYfpaIQfhhJJI5qgnjJmr4hyJbe/zxow=" + AUR_FOLDER=./flood + AUR_REPO=ssh://aur@aur.archlinux.org/nodejs-flood.git + AUR_USER="jesec" + COMMIT_USERNAME="github-actions[bot]" + COMMIT_EMAIL="41898282+github-actions[bot]@users.noreply.github.com" + COMMIT_MESSAGE="Automatic update" + "AUR_KEY=${{ secrets.AUR_KEY }}" + context: ./distribution/archlinux + file: ./distribution/archlinux/Dockerfile.aur + platforms: linux/amd64 diff --git a/distribution/archlinux/Dockerfile.aur b/distribution/archlinux/Dockerfile.aur new file mode 100644 index 00000000..04c6d7c9 --- /dev/null +++ b/distribution/archlinux/Dockerfile.aur @@ -0,0 +1,40 @@ +FROM archlinux + +ARG AUR_FINGERPRINT +ARG AUR_FOLDER +ARG AUR_REPO +ARG AUR_KEY +ARG AUR_USER +ARG COMMIT_USERNAME +ARG COMMIT_EMAIL +ARG COMMIT_MESSAGE + +RUN pacman -Sy --noconfirm base-devel openssh git pacman-contrib + +RUN useradd -m ${AUR_USER} + +USER ${AUR_USER} + +WORKDIR /home/${AUR_USER} + +RUN mkdir .ssh +RUN echo "${AUR_FINGERPRINT}" > .ssh/known_hosts +RUN echo "${AUR_KEY}" > .ssh/id_rsa +RUN chmod 0400 .ssh/id_rsa + +RUN git config --global user.name ${COMMIT_USERNAME} +RUN git config --global user.email ${COMMIT_EMAIL} +RUN git clone ${AUR_REPO} aur + +WORKDIR /home/${AUR_USER}/aur + +RUN rm -rf * +COPY --chown=${AUR_USER}:${AUR_USER} ${AUR_FOLDER}/* ./ +RUN ls -la + +RUN updpkgsums +RUN makepkg --printsrcinfo > .SRCINFO + +RUN git add . +RUN git diff --staged --quiet || git commit -m "${COMMIT_MESSAGE}" +RUN git push diff --git a/distribution/archlinux/README.md b/distribution/archlinux/README.md index 607cdfca..53a0889a 100644 --- a/distribution/archlinux/README.md +++ b/distribution/archlinux/README.md @@ -6,6 +6,6 @@ Tools used for installation: `pacman` `flood` folder contains a working `PKGBUILD`, inspired by [nodejs-yaml](https://github.com/archlinux/svntogit-community/blob/packages/nodejs-yaml/trunk/PKGBUILD) and [nodejs-nativefier](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=nodejs-nativefier). It uses Node.js runtime of system. It complies with Arch Linux package guidelines and should be suitable for submission to Arch Linux official repository. -An upcoming CI will automatically push new releases to AUR (Arch User Repository). +A CI automatically push new releases to AUR (Arch User Repository). Note that checksum is not included in the file. Update it with `updpkgsums` when necessary. diff --git a/distribution/archlinux/flood/.gitignore b/distribution/archlinux/flood/.gitignore new file mode 100644 index 00000000..aa1ec1ea --- /dev/null +++ b/distribution/archlinux/flood/.gitignore @@ -0,0 +1 @@ +*.tgz diff --git a/distribution/archlinux/flood/PKGBUILD b/distribution/archlinux/flood/PKGBUILD index 5dc308b6..f2a4a2d0 100644 --- a/distribution/archlinux/flood/PKGBUILD +++ b/distribution/archlinux/flood/PKGBUILD @@ -1,10 +1,10 @@ -# Maintainer: replace with your name -# Contributor: replace with your name +# Maintainer: replace-with-your-name +# Contributor: replace-with-your-name _npmname=flood -_npmver=4.3.1 +_npmver=4.4.0 pkgname=flood pkgver=$_npmver -pkgrel=0 +pkgrel=1 pkgdesc="A modern web UI for various torrent clients" arch=(any) url="https://flood.js.org"