-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (107 loc) · 3.42 KB
/
pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: GitHub Pages
on:
schedule:
# each sunday at 4:00
- cron: "0 4 * * 0"
push:
branches:
- main
env:
GHCR_IMAGE: "ghcr.io/${{ github.repository_owner }}/${{ 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: |
for xbps_pkg in $(ls -1 $(pwd)/packages); do
cp -R $(pwd)/packages/${xbps_pkg}/templates $(pwd)/void-packages/srcpkgs/${xbps_pkg}
done
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 }}" ${{ github.repository_owner }} ${{ 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/${{ github.repository_owner }}/${{ 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