forked from link-u/davif
-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (96 loc) · 2.58 KB
/
build-debian-packages.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
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
name: Build debian packages
on:
push:
branches-ignore:
- dependabot/**
tags:
- v*
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
codename: [focal, jammy]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build debian package
uses: avif-community/execute-on-separated-ubuntu@main
with:
script: scripts/build-debian-package.sh
on: ${{ matrix.codename }}
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.codename }}
path: |
**/*.ddeb
**/*.deb
- name: Inspect disk usage
shell: bash
run: du -sh .
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
codename: [focal, jammy]
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.codename }}
path: artifact
- name: Check debian package
uses: avif-community/execute-on-separated-ubuntu@main
with:
script: scripts/test.sh
on: ${{ matrix.codename }}
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest
steps:
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
commitish: ${{ github.sha }}
draft: true
prerelease: true
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
codename: [focal, jammy]
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.codename }}
path: ${{ matrix.codename }}
- name: Create a zip
shell: bash
run: zip ${{ matrix.codename }}.zip ${{ matrix.codename }}/*
- name: Upload release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.codename }}.zip
asset_name: ${{ matrix.codename }}.zip
asset_content_type: application/zip