forked from ansible-community/ansible-build-data
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (97 loc) · 3.65 KB
/
antsibull-build.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
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
name: antsibull-build
'on':
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Thursday at 04:00 UTC)
schedule:
- cron: '0 4 * * 4'
workflow_dispatch:
jobs:
build:
name: 'Build Ansible community distribution (${{ matrix.name }})'
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Using ansible_version as X.99.0 since it is unreleased so new deps are generated
- name: Ansible 9
ansible_version: 9.99.0
ansible_major_version: 9
- name: Ansible 10
ansible_version: 10.99.0
ansible_major_version: 10
- name: Ansible 11
ansible_version: 11.99.0
ansible_major_version: 11
- name: Ansible 12
ansible_version: 12.99.0
ansible_major_version: 12
steps:
- name: Check out antsibull-build
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-build
ref: main
path: antsibull-build
- name: Check out antsibull-core
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-core
ref: main
path: antsibull-core
- name: Check out antsibull-changelog
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-changelog
ref: main
path: antsibull-changelog
- name: Check out antsibull-docutils
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-docutils
ref: main
path: antsibull-docutils
- name: Check out antsibull-fileutils
uses: actions/checkout@v4
with:
repository: ansible-community/antsibull-fileutils
ref: main
path: antsibull-fileutils
- name: Pre-create build directory
run: mkdir -p antsibull-build/build
# This is where the antsibull build-release role expects it by default
- name: Check out ansible-build-data under antsibull build directory
uses: actions/checkout@v4
with:
path: antsibull-build/build/ansible-build-data
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
working-directory: antsibull-build
run: |
python3 -m pip install --upgrade pip
python3 -m pip install ansible-core . ../antsibull-core ../antsibull-changelog ../antsibull-docutils ../antsibull-fileutils
ansible-galaxy collection install 'git+https://github.com/ansible-collections/community.general.git'
- name: Lint collection metadata
working-directory: antsibull-build/build/ansible-build-data/${{ matrix.ansible_major_version }}
run: |
antsibull-build lint-build-data ${{ matrix.ansible_major_version }}
- name: Test building a release with the defaults
working-directory: antsibull-build
run: |
ansible-playbook -vv playbooks/build-single-release.yaml \
-e antsibull_data_reset=false \
-e 'antsibull_ansible_version="${{ matrix.ansible_version }}"' \
-e 'antsibull_data_dir="{{ antsibull_data_git_dir }}/${{ matrix.ansible_major_version }}"' \
-e 'antsibull_build_file="ansible-${{ matrix.ansible_major_version }}.build"'
env:
# Make result better readable
ANSIBLE_CALLBACK_RESULT_FORMAT: yaml