-
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (95 loc) · 4.15 KB
/
publish.yml
File metadata and controls
112 lines (95 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Publish createstructure
on:
release:
types: [published]
workflow_dispatch:
jobs:
create-and-update-deb:
runs-on: ubuntu-latest
environment:
name: deb
steps:
- uses: actions/checkout@v2
- name: Get submodules
run: git submodule update --init
- name: Install dependencies
run: |
sudo add-apt-repository ppa:jyrki-pulliainen/dh-virtualenv
sudo apt-get update
sudo apt-get install build-essential debhelper devscripts equivs dh-virtualenv python3.8 gnupg gnupg2 libcurl4-openssl-dev libssl-dev -y
- uses: oprypin/find-latest-tag@v1
with:
repository: createstructure/debian-createstructure
releases-only: true
id : latest
- name: Set envirorment varible(s)
run: |
echo "::set-output name=PUSH_PATH::$(curl -sL https://api.github.com/repos/createstructure/debian-createstructure/releases/latest | jq -r '.upload_url')"
echo "::set-output name=VERSION_TAG::$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')"
echo "::set-output name=DEB_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_amd64.deb"
id: envirorment-variables
- name: Create .deb file
run: |
echo "3.0 (native)" > ./debian/source/format
dpkg-buildpackage -us -uc
mv ../${{ steps.envirorment-variables.outputs.DEB_FILE }} ./
- name: Upload deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.envirorment-variables.outputs.PUSH_PATH }}
asset_path: ${{ steps.envirorment-variables.outputs.DEB_FILE }}
asset_name: ${{ steps.envirorment-variables.outputs.DEB_FILE }}
asset_content_type: application/zip
ppa:
runs-on: ubuntu-latest
environment:
name: ppa
url: https://launchpad.net/~castellanidavide/+archive/ubuntu/createstructure
steps:
- uses: actions/checkout@v2
- name: Get submodules
run: git submodule update --init
- name: Install dependencies
run: |
sudo add-apt-repository ppa:jyrki-pulliainen/dh-virtualenv
sudo apt-get update
sudo apt-get install build-essential debhelper devscripts equivs dh-virtualenv python3.8 gnupg gnupg2 libcurl4-openssl-dev libssl-dev -y
- uses: oprypin/find-latest-tag@v1
with:
repository: createstructure/debian-createstructure
releases-only: true
id : latest
- name: Set envirorment varible(s)
run: |
echo "::set-output name=PUSH_PATH::$(curl -sL https://api.github.com/repos/createstructure/debian-createstructure/releases/latest | jq -r '.upload_url')"
echo "::set-output name=VERSION_TAG::$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')"
echo "::set-output name=TAR_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').orig.tar.gz"
echo "::set-output name=CHANGES_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_source.changes"
id: envirorment-variables
- name: gpg import
run: |
echo "${{ secrets.GPG_PUBKEY }}" > pubkey.txt
echo "${{ secrets.GPG_SECKEY }}" > seckey.txt
echo "${{ secrets.GPG_OTRUST }}" > otrust.txt
LC_ALL=C tr -cd 0-9a-fA-F < pubkey.txt | xxd -r -p > pubkey.asc
LC_ALL=C tr -cd 0-9a-fA-F < seckey.txt | xxd -r -p > seckey.asc
gpg --batch --import pubkey.asc
gpg --batch --passphrase ${{ secrets.GPG_PWS }} --import seckey.asc
sudo echo "export GPGKEY=${{ secrets.GPG_KEY_ID }}" >> ~/.bashrc
gpg --list-secret-keys
- name: Create Debian package
run: |
cd ..
tar -czvf ${{ steps.envirorment-variables.outputs.TAR_FILE }} ./debian-createstructure
cd debian-createstructure
debuild -S -sa -k${{ secrets.GPG_KEY_ID }} -p"gpg --batch --passphrase ${{ secrets.GPG_PWS }} --pinentry-mode loopback"
- name: Checks files
run: |
sudo apt install tree
tree ..
- name: dput
run: |
cd ..
dput ppa:castellanidavide/createstructure ${{ steps.envirorment-variables.outputs.CHANGES_FILE }}