Automatic debian package upload to deb repo #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create package structure | |
run: | | |
mkdir ${{env.pkg_name}} | |
cd ${{env.pkg_name}} | |
mkdir -p DEBIAN usr/local/bin 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 ${{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 ${{env.pkg_name}} | |
- name: Upload deb as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
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/ |