Skip to content

Commit

Permalink
Merge pull request #1956 from OpenEnergyPlatform/feature-automatic-re…
Browse files Browse the repository at this point in the history
…lease-file-attaching

Automatically attach the required files to releases
  • Loading branch information
ColinHDev authored Nov 3, 2024
2 parents 724a52b + 16c1a39 commit a205eff
Showing 1 changed file with 76 additions and 8 deletions.
84 changes: 76 additions & 8 deletions .github/workflows/PostReleaseScripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ name: Post Release Scripts
# - '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:
push:
tags:
- "v*"
branches:
- 'feature-1020-export-of-existing-terms-and-definitions'
release:
types: [published]

jobs:
exportTermsDefinitions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.7'
architecture: x64
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
Expand All @@ -45,7 +43,7 @@ jobs:
run: |
python src/scripts/etd/etd.py
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: existing-terms-and-definitions
path: src/scripts/etd/glossary
Expand All @@ -62,3 +60,73 @@ jobs:
# 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.7.17'
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: http://openenergy-platform.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
steps:
- uses: actions/download-artifact@v4
with:
name: build-files
path: build/oeo
- 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: Attach artifacts to release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
allowUpdates: true
artifacts: "${{ github.workspace }}/build-files.zip,${{ github.workspace }}/existing-terms-and-definitions.zip"

0 comments on commit a205eff

Please sign in to comment.