Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic debian package upload to deb repo #12

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 36 additions & 11 deletions .github/workflows/deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Create debian package

on: [push, pull_request]

env:
pkg_version: 1.2-${{github.run_number}}
pkg_name: fcow_1.2-${{github.run_number}}_all

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -11,23 +15,44 @@ jobs:

- name: Create package structure
run: |
mkdir fcow_1.2-1
cd fcow_1.2-1
mkdir -p DEBIAN usr/local/bin usr/local/man/man6 usr/local/share/fcow
mkdir ${{env.pkg_name}}
cd ${{env.pkg_name}}
mkdir -p DEBIAN usr/local/games usr/local/man/man6 usr/local/share/fcow

- name: Write control
run: |
cat <<EOT >> deb_control
Package: fcow
Version: ${{env.pkg_version}}
Architecture: all
Maintainer: Angel Ruiz Fernandez <[email protected]>
Installed-Size: 5000
Depends: fortune, cowsay, lolcat
Section: game
Priority: optional
Homepage: https://github.com/informaticapau/fcow
Description: A full colored cow will advice your future
EOT

- name: Copy stuff inside
run: |
cp deb_control fcow_1.2-1/DEBIAN/control
cp src/* fcow_1.2-1/usr/local/bin/
chmod +x fcow_1.2-1/usr/local/bin/*
cp share/* fcow_1.2-1/usr/local/share/fcow/
cp man/* fcow_1.2-1/usr/local/man/man6/
cp deb_control ${{env.pkg_name}}/DEBIAN/control
cp src/* ${{env.pkg_name}}/usr/local/games/
chmod +x ${{env.pkg_name}}/usr/local/games/*
cp share/* ${{env.pkg_name}}/usr/local/share/fcow/
cp man/* ${{env.pkg_name}}/usr/local/man/man6/

- name: Create deb package
run: dpkg-deb -Zxz --build fcow_1.2-1
run: dpkg-deb -Zxz --build ${{env.pkg_name}}

- name: Upload deb as artifact
uses: actions/upload-artifact@v3
with:
name: fcow_1.2-1.deb
path: fcow_1.2-1.deb
name: ${{env.pkg_name}}.deb
path: ${{env.pkg_name}}.deb

- name: Install rsync
run: sudo apt-get install rsync

- name: Upload deb to repo
run: RSYNC_PASSWORD=${{secrets.RSYNC_REPO_PASS}} rsync -avz ${{env.pkg_name}}.deb rsync://[email protected]/debupload/pool/contrib/
10 changes: 0 additions & 10 deletions deb_control

This file was deleted.

Loading