.github/workflows/rpm.yml #12
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
on: | |
workflow_dispatch: | |
inputs: | |
ppa: | |
description: "ppa sufix" | |
#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: | |
# This workflow contains a single job called "build" | |
rpbuild: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-22.04 #focal alien is not testing ok on docker fedora | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
#this is locally: throw new Error("Parameter token or opts.auth is required"); | |
- uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
file: ${{ env.name }}_${{ env.version }}_i386.deb | |
target: ${{ env.name }}.deb | |
token: ${{ secrets.PAT }} | |
#repo: 'colin-i/test' | |
#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 | |
#make rpm | |
mkdir out | |
cd out | |
sudo apt update | |
sudo apt install alien | |
sudo alien -rk ../${{ env.name }}.deb | |
fname=`ls` | |
mv ${fname} ../${fname} | |
echo "file=${fname}" >> $GITHUB_ENV | |
- name: artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rpm | |
path: ./${{ env.file }} |