Repository navigation
147 lines (144 loc) · 5.79 KB
/
Copy pathPostReleaseScripts.yml
File metadata and controls
147 lines (144 loc) · 5.79 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
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
137
138
139
140
141
142
143
144
145
146
147
name: Post Release Scripts
# on:
# workflow_dispatch: {}
# push:
# branches:
# - 'feature-1020-export-of-existing-terms-and-definitions'
# First we test the setup, to see if the files are building correctly once that is checked we introduce the wiki upload each release.
on:
release:
types: [published]
jobs:
exportTermsDefinitions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.13.1'
architecture: x64
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: install python dependencies
run: pip install -r src/scripts/requirements.txt
- name: setup robot
run: |
wget https://github.com/ontodev/robot/releases/download/v1.9.0/robot.jar -O src/robot.jar
- name: Build ETD xlsx
run: |
java -jar src/robot.jar merge --input "src/ontology/oeo.omn" \
--input "src/ontology/edits/oeo-model.omn" \
--input "src/ontology/edits/oeo-physical.omn" \
--input "src/ontology/edits/oeo-shared.omn" \
--input "src/ontology/edits/oeo-social.omn" \
--include-annotations true \
export --header "ID|LABEL|definition" \
--prefix "OEO: https://openenergyplatform.org/ontology/oeo/OEO_" \
--sort "LABEL" \
--export "src/scripts/etd/etd.xlsx"
- name: Build ETD md
run: |
python src/scripts/etd/etd.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: existing-terms-and-definitions
path: src/scripts/etd/glossary
# - name: Checkout wiki
# uses: actions/checkout@v2
# with:
# repository: ${{github.repository}}.wiki
# path: wiki
# - name: Push list to wiki
# run: |
# cd wiki
# cp -a ../src/scripts/etd/glossary/. .
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git add .
# git diff-index --quiet HEAD || git commit -m "Add changes" && git push
buildOntologyFullAndClosure:
# steps taken from the build job in automated-testing.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: make
run: |
make
- uses: actions/setup-python@v4
with:
python-version: '3.13.1'
architecture: x64
- name: install python dependencies
run: pip install -r src/scripts/requirements.txt
- name: setup robot 1.9.0
run: |
wget https://github.com/ontodev/robot/releases/download/v1.9.0/robot.jar -O build/robot19.jar
- name: Build ETD xlsx
run: |
java -jar build/robot19.jar merge --input build/oeo/$(cat VERSION)/oeo-full.omn \
--include-annotations true \
export --header "ID|LABEL|definition" \
--prefix "OEO: https://openenergyplatform.org/ontology/oeo/OEO_" \
--sort "LABEL" \
--export $(pwd)/build/oeo/$(cat VERSION)/etd.xlsx
- name: Build ETD csv
run: |
python $(pwd)/src/scripts/etd/etd.py $(pwd)/build/oeo/$(cat VERSION)
- name: Upload Ontology
if: always()
uses: actions/upload-artifact@v4
with:
name: build-files
path: |
build/**/*
!build/**/*.jar
attachArtifactsToRelease:
runs-on: ubuntu-latest
# these jobs have to finish so that the existing-terms-and-definitions and build-files exist
needs: [exportTermsDefinitions, buildOntologyFullAndClosure]
steps:
- uses: actions/download-artifact@v4
with:
name: build-files
path: build
- name: Zip build files again for usage as release artifact
run: |
cd build
zip -r ../build-files.zip oeo
cd ..
- uses: actions/download-artifact@v4
with:
name: existing-terms-and-definitions
path: src/scripts/etd/glossary
- name: Zip terms and definitions for usage as release artifact
run: |
cd src/scripts/etd/glossary
zip -r ../../../../existing-terms-and-definitions.zip ./
cd ../../../..
- name: Copy built ontology files to workspace
run: |
find build/oeo/ -maxdepth 2 \( -name "oeo-full.*" -o -name "oeo-closure.*" \) -exec cp {} ${{ github.workspace }} \;
- name: Attach artifacts to release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
# allowing the action to update the release as it is already created
allowUpdates: true
# omitting the release name, body, draft state and prerelease state so they won't be updated by attaching the artifacts
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
# The default behaviour of this action is to determine the release by the version number.
# We don't want this behaviour, as releases created as draft or pre-release won't be updated in that regard and therefore result in
# unconsistent behaviour when creating normal releases vs. draft or pre-releases.
makeLatest: false
artifacts: "${{ github.workspace }}/build-files.zip,${{ github.workspace }}/existing-terms-and-definitions.zip,${{ github.workspace }}/oeo-full.omn,${{ github.workspace }}/oeo-full.owl,${{ github.workspace }}/oeo-closure.owl"