diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c5771e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,92 @@ +name: Build + +on: + push: + schedule: + # Run every day at 5:20 + - cron: '20 5 * * *' + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - platform: linux/arm64 + arch: aarch64 + image: ghcr.io/fwcd/archlinuxarm-docker + + steps: + - uses: actions/checkout@v3 + with: + submodules: true # TODO: Update submodule + - name: Set up QEMU + if: matrix.platform != 'linux/amd64' + uses: docker/setup-qemu-action@v2 + with: + platforms: ${{ matrix.platform }} + - name: Build packages (${{ matrix.platform }}) + run: > + docker run + --rm + --env BUILDER_UID=$(id -u) + --env BUILDER_GID=$(id -g) + --platform "${{ matrix.platform }}" + --mount type=bind,src="$PWD",dst=/src/arch-repo-aarch64 + --workdir /src/arch-repo-aarch64 + --entrypoint /src/arch-repo-aarch64/src/docker-entrypoint + ${{ matrix.image }} + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.arch }} + path: src/build + retention-days: 1 + + release: + if: github.repository == 'fwcd/arch-repo-aarch64' + runs-on: ubuntu-latest + needs: [build] + + steps: + - uses: actions/checkout@v3 + with: + submodules: true # TODO: Update submodules automatically + - name: Download build artifacts for each architecture + uses: actions/download-artifact@v3 + with: + path: src/build + - name: Build package database + run: > + docker run + --rm + --user "$(id -u):$(id -g)" + --mount type=bind,src="$PWD",dst=/src/arch-repo-aarch64 + --workdir /src/arch-repo-aarch64 + --entrypoint /src/arch-repo-aarch64/src/build-db + archlinux + - name: List db packages + run: ls -l db + - name: Set up Git config + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Commit updates + run: | + git add -A + git commit --allow-empty -m "Update packages ($(date '+%Y-%m-%d-%H-%M'))" + - name: Push changes + if: github.ref == 'refs/heads/main' + run: git push + - name: Publish release + if: github.ref == 'refs/heads/main' + env: + GH_TOKEN: ${{ github.token }} + run: | + tag="$(date '+%Y-%m-%d-%H-%M')" + gh release create --title "$tag" "$tag" || true + gh release upload --clobber "$tag" db/* diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ecbeb98 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +build +db diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..11d0d8e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src"] + path = src + url = ../arch-repo.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..93be14a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 fwcd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..65c5379 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# fwcd's Arch Repository (aarch64) + +[![Build](https://github.com/fwcd/arch-repo-aarch64/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/arch-repo-aarch64/actions/workflows/build.yml) + +aarch64 builds of the packages from [`arch-repo`](https://github.com/fwcd/arch-repo). diff --git a/src b/src new file mode 160000 index 0000000..509d76c --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit 509d76c78984b604c36f51ebe9057df2e071f0f6