feat: apt/dnf repo support (NC Office) - #336
Draft
rikled wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com> Assisted-by: Claude Code:Opus 4.8
|
|
||
| - name: Upload packages as artifact (nextcloud-office) | ||
| if: matrix.brand.name == 'nextcloud-office' && startsWith(github.ref, 'refs/tags/') | ||
| uses: actions/upload-artifact@v4 |
| needs: build | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| steps: | ||
| - uses: actions/download-artifact@v4 |
Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com> Assisted-by: Claude Code:Opus 4.8
Comment on lines
+452
to
+527
| publish-repo: | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| #if: startsWith(github.ref, 'refs/tags/') | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: nc-packages-* | ||
| path: incoming | ||
| merge-multiple: true | ||
|
|
||
| - name: Install repo tooling | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y createrepo-c dpkg-dev apt-utils | ||
|
|
||
| - name: Import signing key | ||
| env: | ||
| GPG_KEY: ${{ secrets.NEXTCLOUD_GPG_PRIVATE_KEY }} | ||
| run: | | ||
| printf '%s\n' "$GPG_KEY" | gpg --batch --import | ||
| echo "KEYID=$(gpg --list-secret-keys --with-colons \ | ||
| | awk -F: '/^sec/{print $5; exit}')" >> $GITHUB_ENV | ||
|
|
||
| - name: Build deb repo | ||
| run: | | ||
| set -euo pipefail | ||
| POOL=repo/deb/pool/main/n/nextcloud-office-documentserver | ||
| mkdir -p "$POOL" | ||
| cp incoming/*.deb "$POOL/" | ||
| cd repo/deb | ||
| for arch in amd64 arm64; do | ||
| d="dists/stable/main/binary-$arch" | ||
| mkdir -p "$d" | ||
| dpkg-scanpackages --arch "$arch" pool > "$d/Packages" | ||
| gzip -9kf "$d/Packages" | ||
| done | ||
| apt-ftparchive \ | ||
| -o APT::FTPArchive::Release::Origin="Nextcloud Office" \ | ||
| -o APT::FTPArchive::Release::Suite=stable \ | ||
| -o APT::FTPArchive::Release::Codename=stable \ | ||
| -o APT::FTPArchive::Release::Components=main \ | ||
| -o APT::FTPArchive::Release::Architectures="amd64 arm64" \ | ||
| release dists/stable > dists/stable/Release | ||
| gpg --batch --yes --default-key "$KEYID" \ | ||
| --clearsign -o dists/stable/InRelease dists/stable/Release | ||
| gpg --batch --yes --default-key "$KEYID" \ | ||
| -abs -o dists/stable/Release.gpg dists/stable/Release | ||
|
|
||
| - name: Build rpm repo | ||
| run: | | ||
| set -euo pipefail | ||
| for arch in x86_64 aarch64; do | ||
| mkdir -p "repo/rpm/$arch" | ||
| cp incoming/*."$arch".rpm "repo/rpm/$arch/" 2>/dev/null || continue | ||
| createrepo_c "repo/rpm/$arch" | ||
| gpg --batch --yes --default-key "$KEYID" \ | ||
| --detach-sign --armor "repo/rpm/$arch/repodata/repomd.xml" | ||
| done | ||
| gpg --armor --export "$KEYID" > repo/nextcloud-office.asc | ||
|
|
||
| - name: Publish via SSH | ||
| env: | ||
| SSH_KEY: ${{ secrets.NEXTCLOUD_SSH_KEY }} | ||
| SSH_HOST: ${{ secrets.NEXTCLOUD_SSH_HOST }} | ||
| SSH_USER: ${{ secrets.NEXTCLOUD_SSH_USER }} | ||
| SSH_PORT: ${{ secrets.NEXTCLOUD_SSH_PORT || 22 }} | ||
| REMOTE_BASE: ${{ secrets.NEXTCLOUD_SSH_REMOTE_PATH }} | ||
| run: | | ||
| set -euo pipefail | ||
| mkdir -p ~/.ssh | ||
| printf '%s\n' "$SSH_KEY" > ~/.ssh/id_deploy | ||
| chmod 600 ~/.ssh/id_deploy | ||
| ssh-keyscan -p "$SSH_PORT" "$SSH_HOST" >> ~/.ssh/known_hosts 2>/dev/null | ||
| rsync -av --delete -e "ssh -i ~/.ssh/id_deploy -p $SSH_PORT" \ | ||
| repo/ "$SSH_USER@$SSH_HOST:$REMOTE_BASE/docserver/repo/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assisted-by: Claude Code:Opus 4.8