Skip to content

Commit

Permalink
upload to rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
doziestar committed Jun 24, 2024
1 parent 226847f commit 3f83576
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 <chidosiky2015@gmail.com>
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
Expand Down Expand Up @@ -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

0 comments on commit 3f83576

Please sign in to comment.