Skip to content

Commit

Permalink
Set up repo
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Aug 13, 2023
0 parents commit 4c3526b
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
build
db
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src"]
path = src
url = ../arch-repo.git
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
1 change: 1 addition & 0 deletions src
Submodule src added at 509d76

0 comments on commit 4c3526b

Please sign in to comment.