-
Notifications
You must be signed in to change notification settings - Fork 19
136 lines (129 loc) · 3.49 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Build debian packages
on:
push:
branches-ignore:
- dependabot/**
tags:
- v*
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
codename: [bionic, focal]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build debian package
uses: link-u/execute-on-separated-ubuntu@master
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: [bionic, focal]
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.codename }}
path: artifact
- name: Check debian package
uses: link-u/execute-on-separated-ubuntu@master
with:
script: scripts/test-debian-package.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: [bionic, focal]
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
deploy:
needs: upload
runs-on: ubuntu-latest
strategy:
matrix:
codename: [bionic, focal]
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.codename }}
path: ${{ matrix.codename }}
- name: Listup files
shell: bash
run: find .
- name: Deploy
shell: bash
run: |
printenv DEPLOY_SCRIPT | base64 -d > deploy.sh
bash deploy.sh upload "${{ matrix.codename }}" "avif" "${{ matrix.codename }}"
env:
DEPLOY_SCRIPT: ${{ secrets.YOROZU_DEPLOY_SCRIPT }}
sign:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Sign
shell: bash
run: |
printenv DEPLOY_SCRIPT | base64 -d > deploy.sh
bash deploy.sh sign
env:
DEPLOY_SCRIPT: ${{ secrets.YOROZU_DEPLOY_SCRIPT }}