Skip to content

Commit

Permalink
deb
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-i committed May 11, 2024
1 parent 0516445 commit 11b1a40
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 27 deletions.
66 changes: 39 additions & 27 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
inputs:
ppa:
description: "ppa sufix"
unpublished:
description: "don't wait to publish, take from build page"
#unpublished:
# description: "don't wait to publish, take from build page"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -15,40 +15,52 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
#Runs a set of commands using the runners shell
- name: Run a multi-line script
- name: get name version
run: |
#proj
name=`cat debian/changelog | head -1 | grep -o ^[^\ ]*`
echo "name=${name}" >> $GITHUB_ENV
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
echo "version=${version}" >> $GITHUB_ENV
- uses: dsaltares/fetch-gh-release-asset@master
#this is locally: throw new Error("Parameter token or opts.auth is required");
with:
#repo: 'colin-i/test'
file: "${{ env.name }}_${{ env.version }}_i386.deb'
target: "${{ env.name }}.deb"
token: ${{ secrets.PAT }}
#Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
#get deb
if [ "${{ github.event.inputs.unpublished }}" = "" ]; then
echo published
dist=`cat debian/changelog | head -1 | grep -Poe "[^ ]*(?=;)"`
src=ppa.launchpadcontent.net/colin-i/ppa${{ github.event.inputs.ppa }}
wget http://${src}/ubuntu/dists/${dist}/main/binary-i386/Packages.xz
xz -d Packages.xz
debfilename=`grep "^Filename.*/${name}_" Packages | tail -1 | cut -d ' ' -f 2`
wget http://${src}/ubuntu/${debfilename} -O ${name}.deb
else
echo unpublished
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
arh=`cat debian/control | grep ^Architecture | cut -d ' ' -f2`
if [ ! -e "lp2.py" ]; then
wget -q https://raw.githubusercontent.com/colin-i/test/master/lp2.py
#on focal is already, python3-launchpadlib is already the newest version
#sudo apt install python3-launchpadlib
fi
OUTPUT=$(python3 lp2.py ppa${{ github.event.inputs.ppa }} ${name} ${version} ${arh})
wget ${OUTPUT}/+files/${name}_${version}_${arh}.deb -O ${name}.deb
#f=`wget -q https://launchpad.net/~colin-i/+archive/ubuntu/ppa${{ github.event.inputs.ppa }}/+build/${{ github.event.inputs.unpublished }} -O - | grep -Poe "[^\"]*(?=\.deb\")"`
#wget ${f}.deb -O ${name}.deb
fi
#if [ "${{ github.event.inputs.unpublished }}" = "" ]; then
# echo published
# dist=`cat debian/changelog | head -1 | grep -Poe "[^ ]*(?=;)"`
# src=ppa.launchpadcontent.net/colin-i/ppa${{ github.event.inputs.ppa }}
# wget http://${src}/ubuntu/dists/${dist}/main/binary-i386/Packages.xz
# xz -d Packages.xz
# debfilename=`grep "^Filename.*/${name}_" Packages | tail -1 | cut -d ' ' -f 2`
# wget http://${src}/ubuntu/${debfilename} -O ${name}.deb
#else
# echo unpublished
# version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
# arh=`cat debian/control | grep ^Architecture | cut -d ' ' -f2`
# if [ ! -e "lp2.py" ]; then
# wget -q https://raw.githubusercontent.com/colin-i/test/master/lp2.py
# #on focal is already, python3-launchpadlib is already the newest version
# #sudo apt install python3-launchpadlib
# fi
# OUTPUT=$(python3 lp2.py ppa${{ github.event.inputs.ppa }} ${name} ${version} ${arh})
# wget ${OUTPUT}/+files/${name}_${version}_${arh}.deb -O ${name}.deb
# #f=`wget -q https://launchpad.net/~colin-i/+archive/ubuntu/ppa${{ github.event.inputs.ppa }}/+build/${{ github.event.inputs.unpublished }} -O - | grep -Poe "[^\"]*(?=\.deb\")"`
# #wget ${f}.deb -O ${name}.deb
#fi
#make rpm
mkdir out
cd out
sudo apt update
sudo apt install alien
sudo alien -rk ../${name}.deb
sudo alien -rk ../${{ env.name }}.deb
fname=`ls`
mv ${fname} ../${fname}
echo "file=${fname}" >> $GITHUB_ENV
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/updeb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

on:
workflow_dispatch:

jobs:
udbuild:
runs-on: ubuntu-18.04
steps:
- name: Run a multi-line script
run: |
if [ -n "${{ env.init }}" ]; then
exit 1
fi
wget https://github.com/colin-i/test/releases/download/1.5/${{ env.proj }} -O 1.txt
echo "up_url=`cat 1.txt`" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ env.up_url }}
asset_path: ./${{ env.file }}
asset_name: ${{ env.file }}
asset_content_type: application/vnd.debian.binary-package
6 changes: 6 additions & 0 deletions arh/pub
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ use_version_txt=1 ~/test/debinit2 "${1}" ${2} && \
#sudo gh act -r -j debuild workflow_dispatch -W .github/workflows/debuild.yml -P ubuntu-18.04=ubuntu:bionic #ubuntu:lucid is the first one
~/test/deb && \
~/test/publp && \
#
~/test/debuild2 x && \
git restore debian/files && \
#git restore? to do at debinit push something
~/test/updeb && \
#
~/test/ai && \
~/test/rpm && \
~/test/del && \
Expand Down

0 comments on commit 11b1a40

Please sign in to comment.