Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 13e6726

Browse files
authored
Added github action for generating releases (#1930)
* Added github action for generating releases * Fixed readme link
1 parent 28154eb commit 13e6726

File tree

2 files changed

+96
-1
lines changed

2 files changed

+96
-1
lines changed

.github/workflows/build-files.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: build-oval-files
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build-xml-files:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Install OS Dependencies
16+
run: sudo apt install -y python3-lxml jq
17+
- uses: actions/setup-python@v3
18+
with:
19+
python-version: '3.x'
20+
architecture: 'x64'
21+
- name: Install Python Dependencies
22+
run: python -m pip install -r scripts/requirements.txt
23+
- name: Build Web Indexes
24+
run: python ./scripts/web_update_indexes.py > /dev/null
25+
- name: Get All Platforms
26+
run: python ./scripts/web_get_repository_stats.py --platform > platforms.json
27+
- name: Get All Families
28+
run: python ./scripts/web_get_repository_stats.py --family > families.json
29+
- name: Get All Classes
30+
run: python ./scripts/web_get_repository_stats.py --class > classes.json
31+
- name: Create Output Directory
32+
run: mkdir ./output-files
33+
- name: Build Individual Files
34+
run: |
35+
declare -a versions=("5.10" "5.11.1" "5.11.2")
36+
for version in "${versions[@]}"
37+
do
38+
cat classes.json | jq '.RESULTS.class | keys[]' | while read class; do
39+
class=`sed -e 's/^"//' -e 's/"$//' <<<"$class"`
40+
if [ ! -z "$class" ]; then
41+
mkdir -p "./output-files/$version/$class/"
42+
43+
cat platforms.json | jq '.RESULTS.platforms | keys[]' | while read platform; do
44+
platform=`sed -e 's/^"//' -e 's/"$//' -e 's/\// /' <<<"$platform"`
45+
platform_filename=`sed -e 's/ /_/g' <<<"$platform"`
46+
echo "Build OVAL Definitions Files for Platform: $platform"
47+
if [ ! -z "$platform" ]; then
48+
python ./scripts/build_oval_definitions_file.py --outfile="./output-files/$version/$class/$platform_filename.xml" --max_schema_version=$version --platform="$platform" --class=$class > /dev/null
49+
fi
50+
done
51+
52+
cat families.json | jq '.RESULTS.family | keys[]' | while read family; do
53+
family=`sed -e 's/^"//' -e 's/"$//' -e 's/\// /' <<<"$family"`
54+
family_filename=`sed -e 's/ /_/g' <<<"$family"`
55+
echo "Build OVAL Definitions Files for Family: $family"
56+
if [ ! -z "$family" ]; then
57+
python ./scripts/build_oval_definitions_file.py --outfile="./output-files/$version/$class/$family_filename.xml" --max_schema_version=$version --family="$family" --class=$class > /dev/null
58+
fi
59+
done
60+
fi
61+
done
62+
done
63+
- name: Build All Definitions File
64+
run: python ./scripts/build_oval_definitions_file.py --all_definitions --outfile ./output-files/oval.xml
65+
- name: Package All Files
66+
run: |
67+
ls -lah ./output-files
68+
zip -r 5.10.zip ./output-files/5.10
69+
zip -r 5.11.1.zip ./output-files/5.11.1
70+
zip -r 5.11.2.zip ./output-files/5.11.2
71+
echo "Release!" > body.md
72+
- name: 'Get Previous tag'
73+
id: previoustag
74+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
75+
with:
76+
fallback: 1.0.0
77+
- name: Bump Release Version
78+
id: bump_version
79+
uses: christian-draeger/[email protected]
80+
with:
81+
current-version: ${{ steps.previoustag.outputs.tag }}
82+
version-fragment: 'feature'
83+
- name: Create Release
84+
uses: ncipollo/release-action@v1
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
artifacts: "*.zip"
89+
bodyFile: "body.md"
90+
token: ${{ secrets.GITHUB_TOKEN }}
91+
tag: ${{ steps.bump_version.outputs.next-version }}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Consumers and contributors are invited to engage using this repository.
1010

1111
## Learn More
1212

13-
- [The OVAL Repository Website](https://oval.cisecurity.org/)
13+
- [The OVAL Repository Website](https://oval.cisecurity.org/) (deprecated)
1414
- Repository Overview (this document)
1515
- [Repository Organization](./repository/README.md)
1616
- [Contributing OVAL](./CONTRIBUTING.md)
@@ -19,6 +19,10 @@ Consumers and contributors are invited to engage using this repository.
1919
- [Get Python 3.4 & Required Packages](./scripts/README.scripting.setup.md)
2020
- [Contributing Scripts](./scripts/CONTRIBUTING.md)
2121

22+
## Generating Files
23+
24+
Since the OVAL Repository Website is being deprecated, files can be generated by cloning the repository and using the scripts from [this page] (https://github.com/CISecurity/OVALRepo/blob/master/scripts/README.md#scripts-for-content-use).
25+
2226
## Status: Work in Progress
2327
*Please note: this documentation is a work in progress. If you have questions or suggestions,
2428
please [create an issue](https://github.com/CISecurity/OVALRepo/issues/new) with a full

0 commit comments

Comments
 (0)