From 66dce09d54b7cc9ab7f1acd51f1e02b8064d9d8d Mon Sep 17 00:00:00 2001 From: garder500 Date: Tue, 28 Oct 2025 18:48:48 +0100 Subject: Ajouter un workflow pour construire et télécharger des paquets Linux (deb, rpm, apk, archlinux) à partir des binaires Go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 130 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78323d7..6030daf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,136 @@ jobs: path: ${{ matrix.output }} retention-days: 7 + # Build Linux packages (deb and apk) + build-packages: + name: Build Linux Packages + needs: build-binaries + runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, arm64] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download binary artifact + uses: actions/download-artifact@v4 + with: + name: sovrabase-linux-${{ matrix.arch }} + + - name: Make binary executable + run: chmod +x sovrabase-linux-${{ matrix.arch }} + + - name: Install nfpm + run: | + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list + sudo apt-get update + sudo apt-get install -y nfpm + + - name: Create nfpm config + run: | + cat > nfpm.yaml <" + description: | + Sovrabase - A modern gRPC server + Built from commit ${GITHUB_SHA::7} + vendor: "Sovrabase" + homepage: "https://github.com/${{ github.repository }}" + license: "MIT" + + contents: + - src: ./sovrabase-linux-${{ matrix.arch }} + dst: /usr/bin/sovrabase + file_info: + mode: 0755 + - src: ./config.toml + dst: /etc/sovrabase/config.toml + type: config + file_info: + mode: 0644 + + overrides: + deb: + scripts: + postinstall: | + #!/bin/sh + echo "Sovrabase installed successfully" + echo "Configuration file: /etc/sovrabase/config.toml" + echo "Run with: sovrabase" + rpm: + scripts: + postinstall: | + #!/bin/sh + echo "Sovrabase installed successfully" + echo "Configuration file: /etc/sovrabase/config.toml" + echo "Run with: sovrabase" + apk: + scripts: + postinstall: | + #!/bin/sh + echo "Sovrabase installed successfully" + echo "Configuration file: /etc/sovrabase/config.toml" + echo "Run with: sovrabase" + archlinux: + scripts: + postinstall: | + #!/bin/sh + echo "Sovrabase installed successfully" + echo "Configuration file: /etc/sovrabase/config.toml" + echo "Run with: sovrabase" + EOF + + - name: Build deb package (Debian/Ubuntu) + run: | + nfpm package --packager deb --target sovrabase_${{ matrix.arch }}.deb + + - name: Build rpm package (Red Hat/Fedora/CentOS) + run: | + nfpm package --packager rpm --target sovrabase_${{ matrix.arch }}.rpm + + - name: Build apk package (Alpine) + run: | + nfpm package --packager apk --target sovrabase_${{ matrix.arch }}.apk + + - name: Build archlinux package (Arch Linux) + run: | + nfpm package --packager archlinux --target sovrabase_${{ matrix.arch }}.pkg.tar.zst + + - name: Upload deb package + uses: actions/upload-artifact@v4 + with: + name: sovrabase_${{ matrix.arch }}.deb + path: sovrabase_${{ matrix.arch }}.deb + retention-days: 30 + + - name: Upload rpm package + uses: actions/upload-artifact@v4 + with: + name: sovrabase_${{ matrix.arch }}.rpm + path: sovrabase_${{ matrix.arch }}.rpm + retention-days: 30 + + - name: Upload apk package + uses: actions/upload-artifact@v4 + with: + name: sovrabase_${{ matrix.arch }}.apk + path: sovrabase_${{ matrix.arch }}.apk + retention-days: 30 + + - name: Upload archlinux package + uses: actions/upload-artifact@v4 + with: + name: sovrabase_${{ matrix.arch }}.pkg.tar.zst + path: sovrabase_${{ matrix.arch }}.pkg.tar.zst + retention-days: 30 + # Build Docker images for multiple architectures build-docker: name: Build Docker Image -- cgit v1.2.3