-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.54 KB
/
package.yml
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
name: Package & Publish
# Run workflow on tags starting with v (eg. v2, v1.2.0)
on:
push:
tags:
- v*
jobs:
package:
runs-on: ubuntu-latest
outputs:
packagename: ${{ steps.package.outputs.file_name }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create debpkg structure
run: |
mkdir -p .debpkg/usr/bin/
mkdir -p .debpkg/DEBIAN/
echo -e "#!/bin/sh\nchmod +x /usr/bin/apt-repo" > .debpkg/DEBIAN/postinst
chmod 755 .debpkg/DEBIAN/postinst
cp apt-repo .debpkg/usr/bin
- uses: jiro4989/build-deb-action@v2
id: package
with:
package: apt-repo
package_root: ./.debpkg
maintainer: Julian Lemmerich <[email protected]>
version: ${{ github.ref }} # refs/tags/v*.*.*
arch: 'amd64'
depends: 'gpg, dpkg-dev'
desc: 'Create the structure for an apt repository to be hosted by nginx.'
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.package.outputs.file_name }}
path: ${{ steps.package.outputs.file_name }}
release:
needs: package
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
id: download
with:
name: ${{ needs.package.outputs.packagename }}
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.RELEASE_PAT }}"
prerelease: false
files: ${{ needs.package.outputs.packagename }}