From de9332bc3c57dd134c005f2c1a28b090c41288f5 Mon Sep 17 00:00:00 2001 From: "Chidozie C. Okafor" <39489124+doziestar@users.noreply.github.com> Date: Tue, 25 Jun 2024 00:48:15 +0200 Subject: [PATCH] upload to linux --- .github/workflows/rust.yml | 45 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b181a3b..ddb4000 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -162,31 +162,25 @@ jobs: path: ./ - name: Extract release artifact run: tar -xzvf server_forge-x86_64-unknown-linux-gnu.tar.gz + - name: Set version + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV - name: Create DEB package run: | - # Remove 'v' prefix from version if present - VERSION="${{ github.ref_name }}" - VERSION="${VERSION#v}" - - mkdir -p serverforge_${VERSION}_amd64/DEBIAN + mkdir -p serverforge_${{ env.VERSION }}_amd64/DEBIAN echo "Package: serverforge - Version: ${VERSION} + Version: ${{ env.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_${VERSION}_amd64/usr/local/bin/ - dpkg-deb --build serverforge_${VERSION}_amd64 + Description: ServerForge - A robust server setup and maintenance tool" > serverforge_${{ env.VERSION }}_amd64/DEBIAN/control + mkdir -p serverforge_${{ env.VERSION }}_amd64/usr/local/bin + cp server_forge serverforge_${{ env.VERSION }}_amd64/usr/local/bin/ + dpkg-deb --build serverforge_${{ env.VERSION }}_amd64 - name: Create RPM package run: | - # Remove 'v' prefix from version if present - VERSION="${{ github.ref_name }}" - VERSION="${VERSION#v}" - mkdir -p ~/rpmbuild/{SPECS,SOURCES,BUILD,RPMS,SRPMS} cp server_forge ~/rpmbuild/SOURCES/ echo "Name: serverforge - Version: ${VERSION} + Version: ${{ env.VERSION }} Release: 1 Summary: ServerForge - A robust server setup and maintenance tool License: MIT @@ -204,16 +198,21 @@ jobs: %clean rm -rf %{buildroot}" > ~/rpmbuild/SPECS/serverforge.spec rpmbuild -ba ~/rpmbuild/SPECS/serverforge.spec - - name: Upload Linux packages + - name: Upload DEB package + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./serverforge_${{ env.VERSION }}_amd64.deb + asset_name: serverforge_${{ env.VERSION }}_amd64.deb + asset_content_type: application/vnd.debian.binary-package + - name: Upload RPM package uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: | - ./serverforge_${VERSION}_amd64.deb - ~/rpmbuild/RPMS/x86_64/serverforge-${VERSION}-1.x86_64.rpm - asset_name: | - serverforge_${VERSION}_amd64.deb - serverforge-${VERSION}-1.x86_64.rpm - asset_content_type: application/octet-stream \ No newline at end of file + 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/x-rpm \ No newline at end of file