-
Notifications
You must be signed in to change notification settings - Fork 24
133 lines (131 loc) · 16 KB
/
release.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
---
name: "tagged-release"
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
hardening:
name: Harden runner
uses: ./.github/workflows/hardening.yaml
tagged-release:
name: "Tagged Release"
needs: hardening
permissions:
contents: write
runs-on: "ubuntu-latest"
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Set the pip environment up
- name: Get Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.11'
cache: 'pipenv' # caching pip dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt --require-hashes
pipenv install --ignore-pipfile --dev
# Run the tests
- name: Run unit tests
run: pipenv run python -m unittest discover -s "tests/scripts" -p "*_utest.py"
- name: Run integration
run: pipenv run python -m unittest discover -s "tests/scripts" -p "*_itest.py"
# Test coverage reports
- name: Check test coverage - run tests
run: pipenv run coverage run -m unittest discover -s "tests/scripts" -p "*_*test.py"
- name: Check test coverage - generate xml
run: pipenv run coverage xml
- name: Check test coverage - Report
run: pipenv run coverage report --fail-under 85 scripts/convert*
- name: Generate new output file
run: |
#
# Building EoP
mkdir -p output/eop || echo "Ignore error"
mkdir -p output/eop/Links || echo "Ignore error"
mkdir -p output/eop/Fonts || echo "Ignore error"
cp -rf ./resources/templates/Links/eop output/eop/Links/
cp -rf ./resources/templates/Fonts/Selawik/* output/eop/Fonts/
cp -rf ./resources/templates/Fonts/OpenSans/* output/eop/Fonts/
pipenv run python scripts/convert.py -t tarot -l en -lt deck -v 1.0 -e eop -i ./resources/templates/eop_ver_deck_tarot_lang.idml -o ./output/eop/eop-1.0-deck-en.idml
pipenv run python scripts/convert.py -t tarot -l es -lt deck -v 1.0 -e eop -i ./resources/templates/eop_ver_deck_tarot_lang.idml -o ./output/eop/eop-1.0-deck-es.idml
pipenv run python scripts/convert.py -t tarot -l en -lt instructions1 -v 1.0 -e eop -i ./resources/templates/eop_ver_instructions1_tarot_lang.idml -o ./output/eop/1_instructionCard1.idml
pipenv run python scripts/convert.py -t tarot -l en -lt instructions2 -v 1.0 -e eop -i ./resources/templates/eop_ver_instructions2_tarot_lang.idml -o ./output/eop/1_instructionCard2.idml
pipenv run python scripts/convert.py -t tarot -l en -lt strategy-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_strategy-cards_tarot_lang.idml -o ./output/eop/2_StrategyCard.idml
pipenv run python scripts/convert.py -t tarot -l en -lt cards -v 1.0 -e eop -i ./resources/templates/eop_ver_cards_tarot_lang.idml -o ./output/eop/3_PlayingCards.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-spoofing-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-spoofing-cards_tarot_lang.idml -o ./output/eop/4_1THREATCARD-Spoofing.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-tampering-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-tampering-cards_tarot_lang.idml -o ./output/eop/4_2THREATCARD-Tampering.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-repudation-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-repudation-cards_tarot_lang.idml -o ./output/eop/4_3THREATCARD-Repudiation.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-infodisclosure-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-infodisclosure-cards_tarot_lang.idml -o ./output/eop/4_4THREATCARD-InfoDisclosure.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-denialofsvc-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-denialofsvc-cards_tarot_lang.idml -o ./output/eop/4_5THREATCARD-DenialofSvc.idml
pipenv run python scripts/convert.py -t tarot -l en -lt threat-elevofpriv-cards -v 1.0 -e eop -i ./resources/templates/eop_ver_threat-elevofpriv-cards_tarot_lang.idml -o ./output/eop/4_6THREATCARD-ElevofPriv.idml
pipenv run python scripts/convert.py -t tarot -l en -lt about -v 1.0 -e eop -i ./resources/templates/eop_ver_about_tarot_lang.idml -o ./output/eop/5_AboutCard.idml
zip -r output/eop-1.0.zip output/eop
#
# Building Cornucopia WebApp Edition
mkdir -p output/cornucopia_webapp || echo "Ignore error"
mkdir -p output/cornucopia_webapp/Links || echo "Ignore error"
mkdir -p output/cornucopia_webapp/Fonts || echo "Ignore error"
cp -rf ./resources/templates/Links/cornucopia_webapp output/cornucopia_webapp/Links/
cp -rf ./resources/templates/Fonts/NotoSans/* output/cornucopia_webapp/Fonts/
cp -rf ./resources/templates/Fonts/FivoSans/* output/cornucopia_webapp/Fonts/
cp -rf ./resources/templates/Fonts/Atkinson-Hyperlegible/* output/cornucopia_webapp/Fonts/
#
# Building Cornucopia MobileApp Edition
mkdir -p output/cornucopia_mobileapp || echo "Ignore error"
mkdir -p output/cornucopia_mobileapp/Links || echo "Ignore error"
mkdir -p output/cornucopia_mobileapp/Fonts || echo "Ignore error"
cp -rf ./resources/templates/Links/cornucopia_mobileapp output/cornucopia_mobileapp/Links/
cp -rf ./resources/templates/Fonts/NotoSans/* output/cornucopia_mobileapp/Fonts/
cp -rf ./resources/templates/Fonts/FivoSans/* output/cornucopia_mobileapp/Fonts/
cp -rf ./resources/templates/Fonts/Atkinson-Hyperlegible/* output/cornucopia_mobileapp/Fonts/
#
pipenv run python scripts/convert.py -l all -lt all -t all -v 2.00 -e webapp
pipenv run python scripts/convert.py -l en -lt all -t all -v 1.00 -e mobileapp
#
cp output/owasp_cornucopia_mobileapp_1.00_cards_bridge_en.idml output/owasp_cornucopia_mobileapp_1.00_cards_bridge_qr_en.idml output/owasp_cornucopia_mobileapp_1.00_cards_tarot_en.idml output/owasp_cornucopia_mobileapp_1.00_cards_tarot_qr_en.idml output/owasp_cornucopia_mobileapp_1.00_leaflet_bridge_en.idml output/owasp_cornucopia_mobileapp_1.00_leaflet_tarot_en.idml output/cornucopia_mobileapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_en.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_en.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_en.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_en.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_en.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_en.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_es.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_es.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_es.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_es.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_es.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_es.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_fr.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_fr.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_fr.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_fr.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_fr.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_fr.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_nl.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_nl.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_nl.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_nl.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_nl.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_nl.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_no-nb.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_no-nb.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_no-nb.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_no-nb.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_no-nb.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_no-nb.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_pt-br.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_pt-br.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_pt-br.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_pt-br.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_pt-br.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_pt-br.idml output/cornucopia_webapp/
cp output/owasp_cornucopia_webapp_2.00_cards_bridge_pt-pt.idml output/owasp_cornucopia_webapp_2.00_cards_bridge_qr_pt-pt.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_pt-pt.idml output/owasp_cornucopia_webapp_2.00_cards_tarot_qr_pt-pt.idml output/owasp_cornucopia_webapp_2.00_leaflet_bridge_pt-pt.idml output/owasp_cornucopia_webapp_2.00_leaflet_tarot_pt-pt.idml output/cornucopia_webapp/
zip -r output/owasp_cornucopia_mobileapp_1.00_en.zip output/cornucopia_mobileapp/Links/* output/cornucopia_mobileapp/Fonts/* output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_cards_bridge_en.idml output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_cards_bridge_qr_en.idml output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_cards_tarot_en.idml output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_cards_tarot_qr_en.idml output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_leaflet_bridge_en.idml output/cornucopia_mobileapp/owasp_cornucopia_mobileapp_1.00_leaflet_tarot_en.idml ./resources/templates/owasp_cornucopia_mobileapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_en.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_en.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_en.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_en.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_en.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_en.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_en.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_es.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_es.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_es.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_es.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_es.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_es.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_es.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_fr.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_fr.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_fr.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_fr.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_fr.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_fr.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_fr.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_nl.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_nl.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_nl.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_nl.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_nl.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_nl.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_nl.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_no-nb.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_no-nb.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_no-nb.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_no-nb.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_no-nb.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_no-nb.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_no-nb.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_pt-br.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_pt-br.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_pt-br.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_pt-br.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_pt-br.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_pt-br.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_pt-br.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
zip -r output/owasp_cornucopia_webapp_2.00_pt-pt.zip output/cornucopia_webapp/Links/* output/cornucopia_webapp/Fonts/* output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_pt-pt.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_bridge_qr_pt-pt.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_pt-pt.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_cards_tarot_qr_pt-pt.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_bridge_pt-pt.idml output/cornucopia_webapp/owasp_cornucopia_webapp_2.00_leaflet_tarot_pt-pt.idml ./resources/templates/owasp_cornucopia_webapp_scoresheet.pdf
- uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
name: "Create release"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
CHANGELOG.md
LICENSE.md
README.md
creative-commons-attribution-3.0.txt
output/eop-1.0.zip
output/owasp_cornucopia_mobileapp_1.00_en.zip
output/owasp_cornucopia_webapp_2.00_en.zip
output/owasp_cornucopia_webapp_2.00_es.zip
output/owasp_cornucopia_webapp_2.00_fr.zip
output/owasp_cornucopia_webapp_2.00_nl.zip
output/owasp_cornucopia_webapp_2.00_no-nb.zip
output/owasp_cornucopia_webapp_2.00_pt-br.zip
output/owasp_cornucopia_webapp_2.00_guide_bridge_en.docx
output/owasp_cornucopia_webapp_2.00_guide_bridge_es.docx
output/owasp_cornucopia_webapp_2.00_guide_bridge_fr.docx
output/owasp_cornucopia_webapp_2.00_guide_bridge_nl.docx
output/owasp_cornucopia_webapp_2.00_guide_bridge_no-nb.docx
output/owasp_cornucopia_webapp_2.00_guide_bridge_pt-br.docx
resources/case/*
source/*.yaml