From 3f8357677ef923c6213fe643d108af57fc9fbd41 Mon Sep 17 00:00:00 2001 From: "Chidozie C. Okafor" <39489124+doziestar@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:10:37 +0200 Subject: [PATCH] upload to rpm --- .github/workflows/rust.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 471c5c5..b4783f2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -156,7 +156,7 @@ jobs: - name: Install dependencies run: sudo apt-get update && sudo apt-get install -y rpm - name: Set version - run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV + run: echo "VERSION=${GITHUB_REF_NAME#refs/tags/v}" >> $GITHUB_ENV - name: Download release artifact uses: actions/download-artifact@v3 with: @@ -166,29 +166,27 @@ jobs: run: tar -xzvf server_forge-x86_64-unknown-linux-gnu.tar.gz - name: Create DEB package run: | - # Remove 'v' prefix from version if present - VERSION="${{ github.ref_name }}" + # Get the version from the environment file VERSION="${{ env.VERSION }}" mkdir -p serverforge_${VERSION}_amd64/DEBIAN echo "Package: serverforge - Version: ${{ env.VERSION }} + Version: ${VERSION} Architecture: amd64 Maintainer: Chidozie C. Okafor Description: ServerForge - A robust server setup and maintenance tool" > serverforge_${VERSION}_amd64/DEBIAN/control mkdir -p serverforge_${VERSION}_amd64/usr/local/bin - cp server_forge serverforge_${{ env.VERSION }}_amd64/usr/local/bin/ - dpkg-deb --build serverforge_${{ env.VERSION }}_amd64 + cp server_forge serverforge_${VERSION}_amd64/usr/local/bin/ + dpkg-deb --build serverforge_${VERSION}_amd64 - name: Create RPM package run: | - # Remove 'v' prefix from version if present - VERSION="${{ github.ref_name }}" + # Get the version from the environment file VERSION="${{ env.VERSION }}" mkdir -p ~/rpmbuild/{SPECS,SOURCES,BUILD,RPMS,SRPMS} cp server_forge ~/rpmbuild/SOURCES/ echo "Name: serverforge - Version: ${{ env.VERSION }} + Version: ${VERSION} Release: 1 Summary: ServerForge - A robust server setup and maintenance tool License: MIT @@ -224,3 +222,4 @@ jobs: asset_path: ~/rpmbuild/RPMS/x86_64/serverforge-${{ env.VERSION }}-1.x86_64.rpm asset_name: serverforge-${{ env.VERSION }}-1.x86_64.rpm asset_content_type: application/octet-stream +