Skip to content

Commit

Permalink
upload to linux
Browse files Browse the repository at this point in the history
  • Loading branch information
doziestar committed Jun 24, 2024
1 parent fb95f1a commit de9332b
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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_${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
Expand All @@ -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
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

0 comments on commit de9332b

Please sign in to comment.