Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically attach the required files to releases #1956

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading