mirror of
https://github.com/xHyroM/void-packages.git
synced 2024-11-10 00:48:06 +01:00
118 lines
3.2 KiB
YAML
118 lines
3.2 KiB
YAML
# https://github.com/xdeb-org/voidlinux-repository/blob/main/.github/workflows/pages.yml
|
|
|
|
name: Pages
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
GHCR_IMAGE: "ghcr.io/xhyrom/${{ github.event.repository.name }}"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- arch: x86_64
|
|
platform: linux/amd64
|
|
# - arch: i686
|
|
# platform: linux/i386
|
|
#- arch: aarch64
|
|
# platform: linux/arm64
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: ${{ matrix.config.platform }}
|
|
|
|
- name: Create XBPS packages
|
|
run: |
|
|
repository_dir="repository-${{ matrix.config.arch }}"
|
|
mkdir -p ${repository_dir}
|
|
|
|
docker run --rm \
|
|
-v $(pwd):/workspace \
|
|
--platform ${{ matrix.config.platform }} \
|
|
${GHCR_IMAGE}:${{ matrix.config.arch }} \
|
|
/workspace/scripts/create_packages.sh ${{ matrix.config.arch }} ${{ matrix.config.sha256 }}
|
|
|
|
sudo chown -R $(id -u):$(id -g) void-packages/hostdir/binpkgs
|
|
mv void-packages/hostdir/binpkgs/*.xbps ${repository_dir}
|
|
|
|
- name: Create XBPS repository
|
|
run: |
|
|
echo -n "${{ secrets.XBPS_REPOSITORY_KEY }}" > private.pem
|
|
|
|
docker run --rm \
|
|
-v $(pwd):/workspace \
|
|
--platform ${{ matrix.config.platform }} \
|
|
${GHCR_IMAGE}:${{ matrix.config.arch }} \
|
|
/workspace/scripts/sign_repository.sh "repository-${{ matrix.config.arch }}" "xhyrom" ${{ github.event.pusher.email }}
|
|
|
|
- name: Upload repository as artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: "repository-${{ matrix.config.arch }}"
|
|
path: "repository-${{ matrix.config.arch }}"
|
|
|
|
merge:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
container:
|
|
image: ghcr.io/xhyrom/${{ github.event.repository.name }}:x86_64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Download all build artifacts
|
|
uses: actions/download-artifact@v3
|
|
|
|
- name: Merge artifacts
|
|
run: |
|
|
mkdir -p repository
|
|
mv repository-x86_64/* repository
|
|
#mv repository-i686/* repository
|
|
#mv repository-aarch64/* repository
|
|
|
|
- name: Build apindex
|
|
run: |
|
|
cd apindex
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/apindex
|
|
make install
|
|
|
|
- name: Generate index.html
|
|
run: cd repository && /tmp/apindex/bin/apindex .
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v2
|
|
with:
|
|
path: repository
|
|
|
|
deploy:
|
|
needs: merge
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v2
|