-
Notifications
You must be signed in to change notification settings - Fork 29
84 lines (82 loc) · 3.32 KB
/
_build_deb_reusable.yml
File metadata and controls
84 lines (82 loc) · 3.32 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
name: Reusable Build Deb
on:
workflow_call:
inputs:
rake-job:
required: true
type: string
rake-options:
required: false
type: string
default: ""
run-on:
required: true
type: string
next-major:
required: true
type: boolean
cache-group:
required: true
type: string
jobs:
build:
runs-on: ${{ inputs.run-on }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: cache deb
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache-deb
with:
path: |
fluent-package/apt/repositories
fluent-apt-source/apt/repositories
fluent-lts-apt-source/apt/repositories
v7-test/fluent-package/apt/repositories
key: ${{ runner.os }}-cache-${{ inputs.rake-job }}-${{ runner.arch }}-${{ inputs.cache-group }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', 'fluent-package/templates/**', 'fluent-package/debian/**', 'fluent-package/apt/**/Dockerfile') }}
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
with:
ruby-version: '3.4'
- name: Install dependencies
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
gem install serverspec --no-document
- name: Build deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit && ! inputs.next-major }}
run: |
rake apt:build APT_TARGETS=${{ inputs.rake-job }} ${{ inputs.rake-options }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ ! steps.cache-deb.outputs.cache-hit && inputs.next-major }}
with:
path: v7-test
- name: Build v7 deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit && inputs.next-major }}
run: |
cd v7-test
git config user.email "fluentd@googlegroups.com"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v7.patch
rake apt:build APT_TARGETS=${{ inputs.rake-job }} ${{ inputs.rake-options }}
- name: Upload fluent-package deb
if: ${{ ! inputs.next-major }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: packages-${{ inputs.rake-job }}
path: fluent-package/apt/repositories
- name: Upload fluent-apt-source deb
if: ${{ ! inputs.next-major }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: packages-apt-source-${{ inputs.rake-job }}
path: fluent-apt-source/apt/repositories
- name: Upload fluent-lts-apt-source deb
if: ${{ ! inputs.next-major }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: packages-lts-apt-source-${{ inputs.rake-job }}
path: fluent-lts-apt-source/apt/repositories
- name: Upload v7 fluent-package deb
if: ${{ inputs.next-major }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: v7-packages-${{ inputs.rake-job }}
path: v7-test/fluent-package/apt/repositories