-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (56 loc) · 1.9 KB
/
release.yml
File metadata and controls
72 lines (56 loc) · 1.9 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
name: Build Package
on:
push:
branches: "master"
paths:
- "usr/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Update package and install dpkg-dev
run: sudo apt-get update && sudo apt-get install -y dpkg-dev
- name: Checkout
run: git clone https://github.com/jd-apprentice/dbn-tools.git && cd dbn-tools
- name: Get Package Version
id: get_version
run: |
file=$(find ./dbn-tools/DEBIAN -name 'control')
string="Version"
while read -r line; do
if [[ $line =~ $string ]]; then
version=${line:9}
fi
done <$file
echo "::set-output name=version::$version"
- name: Execute Bash Script
run: |
cd dbn-tools
rm -rf .git
rm -rf *.png
rm -rf *.md
cd ..
dpkg-deb -b dbn-tools "${{ steps.get_version.outputs.version }}"-dbn-tools.deb
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: 📦 ${{ steps.get_version.outputs.version }}
body: |
🤖 Release automatically generated by GitHub Actions
draft: false
prerelease: false
files: |
${{ steps.get_version.outputs.version }}-dbn-tools.deb
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.get_version.outputs.version }}-dbn-tools.deb
asset_name: ${{ steps.get_version.outputs.version }}-dbn-tools.deb
asset_content_type: application/octet-stream