Skip to content

Commit 11b1a40

Browse files
committed
deb
1 parent 0516445 commit 11b1a40

File tree

3 files changed

+69
-27
lines changed

3 files changed

+69
-27
lines changed

.github/workflows/rpm.yml

+39-27
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
inputs:
44
ppa:
55
description: "ppa sufix"
6-
unpublished:
7-
description: "don't wait to publish, take from build page"
6+
#unpublished:
7+
# description: "don't wait to publish, take from build page"
88

99
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1010
jobs:
@@ -15,40 +15,52 @@ jobs:
1515
# Steps represent a sequence of tasks that will be executed as part of the job
1616
steps:
1717
- uses: actions/checkout@v3
18-
#Runs a set of commands using the runners shell
19-
- name: Run a multi-line script
18+
- name: get name version
2019
run: |
2120
#proj
2221
name=`cat debian/changelog | head -1 | grep -o ^[^\ ]*`
22+
echo "name=${name}" >> $GITHUB_ENV
23+
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
24+
echo "version=${version}" >> $GITHUB_ENV
25+
- uses: dsaltares/fetch-gh-release-asset@master
26+
#this is locally: throw new Error("Parameter token or opts.auth is required");
27+
with:
28+
#repo: 'colin-i/test'
29+
file: "${{ env.name }}_${{ env.version }}_i386.deb'
30+
target: "${{ env.name }}.deb"
31+
token: ${{ secrets.PAT }}
32+
#Runs a set of commands using the runners shell
33+
- name: Run a multi-line script
34+
run: |
2335
#get deb
24-
if [ "${{ github.event.inputs.unpublished }}" = "" ]; then
25-
echo published
26-
dist=`cat debian/changelog | head -1 | grep -Poe "[^ ]*(?=;)"`
27-
src=ppa.launchpadcontent.net/colin-i/ppa${{ github.event.inputs.ppa }}
28-
wget http://${src}/ubuntu/dists/${dist}/main/binary-i386/Packages.xz
29-
xz -d Packages.xz
30-
debfilename=`grep "^Filename.*/${name}_" Packages | tail -1 | cut -d ' ' -f 2`
31-
wget http://${src}/ubuntu/${debfilename} -O ${name}.deb
32-
else
33-
echo unpublished
34-
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
35-
arh=`cat debian/control | grep ^Architecture | cut -d ' ' -f2`
36-
if [ ! -e "lp2.py" ]; then
37-
wget -q https://raw.githubusercontent.com/colin-i/test/master/lp2.py
38-
#on focal is already, python3-launchpadlib is already the newest version
39-
#sudo apt install python3-launchpadlib
40-
fi
41-
OUTPUT=$(python3 lp2.py ppa${{ github.event.inputs.ppa }} ${name} ${version} ${arh})
42-
wget ${OUTPUT}/+files/${name}_${version}_${arh}.deb -O ${name}.deb
43-
#f=`wget -q https://launchpad.net/~colin-i/+archive/ubuntu/ppa${{ github.event.inputs.ppa }}/+build/${{ github.event.inputs.unpublished }} -O - | grep -Poe "[^\"]*(?=\.deb\")"`
44-
#wget ${f}.deb -O ${name}.deb
45-
fi
36+
#if [ "${{ github.event.inputs.unpublished }}" = "" ]; then
37+
# echo published
38+
# dist=`cat debian/changelog | head -1 | grep -Poe "[^ ]*(?=;)"`
39+
# src=ppa.launchpadcontent.net/colin-i/ppa${{ github.event.inputs.ppa }}
40+
# wget http://${src}/ubuntu/dists/${dist}/main/binary-i386/Packages.xz
41+
# xz -d Packages.xz
42+
# debfilename=`grep "^Filename.*/${name}_" Packages | tail -1 | cut -d ' ' -f 2`
43+
# wget http://${src}/ubuntu/${debfilename} -O ${name}.deb
44+
#else
45+
# echo unpublished
46+
# version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
47+
# arh=`cat debian/control | grep ^Architecture | cut -d ' ' -f2`
48+
# if [ ! -e "lp2.py" ]; then
49+
# wget -q https://raw.githubusercontent.com/colin-i/test/master/lp2.py
50+
# #on focal is already, python3-launchpadlib is already the newest version
51+
# #sudo apt install python3-launchpadlib
52+
# fi
53+
# OUTPUT=$(python3 lp2.py ppa${{ github.event.inputs.ppa }} ${name} ${version} ${arh})
54+
# wget ${OUTPUT}/+files/${name}_${version}_${arh}.deb -O ${name}.deb
55+
# #f=`wget -q https://launchpad.net/~colin-i/+archive/ubuntu/ppa${{ github.event.inputs.ppa }}/+build/${{ github.event.inputs.unpublished }} -O - | grep -Poe "[^\"]*(?=\.deb\")"`
56+
# #wget ${f}.deb -O ${name}.deb
57+
#fi
4658
#make rpm
4759
mkdir out
4860
cd out
4961
sudo apt update
5062
sudo apt install alien
51-
sudo alien -rk ../${name}.deb
63+
sudo alien -rk ../${{ env.name }}.deb
5264
fname=`ls`
5365
mv ${fname} ../${fname}
5466
echo "file=${fname}" >> $GITHUB_ENV

.github/workflows/updeb.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
udbuild:
7+
runs-on: ubuntu-18.04
8+
steps:
9+
- name: Run a multi-line script
10+
run: |
11+
if [ -n "${{ env.init }}" ]; then
12+
exit 1
13+
fi
14+
wget https://github.com/colin-i/test/releases/download/1.5/${{ env.proj }} -O 1.txt
15+
echo "up_url=`cat 1.txt`" >> $GITHUB_ENV
16+
- name: Upload Release Asset
17+
uses: actions/upload-release-asset@v1
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.PAT }}
20+
with:
21+
upload_url: ${{ env.up_url }}
22+
asset_path: ./${{ env.file }}
23+
asset_name: ${{ env.file }}
24+
asset_content_type: application/vnd.debian.binary-package

arh/pub

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use_version_txt=1 ~/test/debinit2 "${1}" ${2} && \
1111
#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
1212
~/test/deb && \
1313
~/test/publp && \
14+
#
15+
~/test/debuild2 x && \
16+
git restore debian/files && \
17+
#git restore? to do at debinit push something
18+
~/test/updeb && \
19+
#
1420
~/test/ai && \
1521
~/test/rpm && \
1622
~/test/del && \

0 commit comments

Comments
 (0)