From 6b27afa934b59a32120624dce80edeacc9000dd9 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 19 Dec 2023 14:38:26 +0100 Subject: [PATCH] workflows:release - generate JSON files from YAML files on release --- .github/workflows/release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cad3128..2ed38a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,15 @@ jobs: - name: Get Tag id: tag run: echo "tag=$(git tag -l --sort=-version:refname | head -1)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install Dependencies + run: python -m pip install pyyaml + - name: Generate JSON Files + run: | + python3 -c 'import yaml,json,sys;json.dump(yaml.load(open(sys.argv[1]), yaml.Loader), open(sys.argv[2], "w"))' fileformats.yml fileformats.json + python3 -c 'import yaml,json,sys;json.dump(yaml.load(open(sys.argv[1]), yaml.Loader), open(sys.argv[2], "w"))' custom_signatures.yml custom_signatures.json - name: Create Release uses: softprops/action-gh-release@v1 with: @@ -25,4 +34,5 @@ jobs: files: | fileformats.yml custom_signatures.yml + fileformats.json custom_signatures.json