Skip to content

Commit c797770

Browse files
authored
feat: fixes for apt (goharbor#813)
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
1 parent b36a243 commit c797770

2 files changed

Lines changed: 62 additions & 3 deletions

File tree

.dagger/apt.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (m *HarborCli) AptBuild(ctx context.Context,
4040

4141
// Building `Package` file for each arch
4242
for _, arch := range archs {
43-
pkgDir := fmt.Sprintf("buildDirs/stable/main/binary-%s", arch)
43+
pkgDir := fmt.Sprintf("dists/stable/main/binary-%s", arch)
4444
poolDir := "pool/main/m"
4545

4646
container = container.WithExec([]string{
@@ -53,7 +53,7 @@ func (m *HarborCli) AptBuild(ctx context.Context,
5353
// Release File
5454
container = container.WithExec([]string{
5555
"bash", "-c",
56-
`cat <<EOF > /repo/buildDirs/stable/Release
56+
`cat <<EOF > /repo/dists/stable/Release
5757
Origin: https://github.com/goharbor/harbor-cli
5858
Label: HarborCLI
5959
Suite: stable
@@ -79,7 +79,7 @@ EOF`,
7979
git config user.name "github-actions[bot]"
8080
git config user.email "github-actions[bot]@users.noreply.github.com"
8181
82-
git add buildDirs pool
82+
git add dists pool
8383
8484
git commit -m "Update APT repo for %s" || echo "No changes to commit"
8585
git push origin gh-pages -f

.github/workflows/pages.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Pages Rebuild
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-pages:
8+
permissions:
9+
contents: write
10+
packages: write
11+
id-token: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
if: |
16+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
17+
(github.event_name == 'workflow_dispatch')
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
22+
23+
- name: Create Build Dir
24+
if: |
25+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
26+
(github.event_name == 'workflow_dispatch')
27+
run: mkdir -p dist
28+
29+
- name: Building Binaries
30+
if: |
31+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
32+
(github.event_name == 'workflow_dispatch')
33+
uses: dagger/dagger-for-github@v7
34+
with:
35+
version: "latest"
36+
verb: call
37+
args: "build --build-dir=./dist export --path=./dist"
38+
39+
- name: NFPM Build (deb/rpm)
40+
if: |
41+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
42+
(github.event_name == 'workflow_dispatch')
43+
uses: dagger/dagger-for-github@v7
44+
with:
45+
version: "latest"
46+
verb: call
47+
args: "nfpm-build --build-dir=./dist export --path=./dist"
48+
49+
- name: Apt Build
50+
if: |
51+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
52+
(github.event_name == 'workflow_dispatch')
53+
uses: dagger/dagger-for-github@v7
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
version: "latest"
58+
verb: call
59+
args: "apt-build --build-dir=./dist --token=env://GITHUB_TOKEN "

0 commit comments

Comments
 (0)