From 8175590bef9e279b8e5c70c7388d595ba7c50c7c Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 4 Jun 2024 13:06:03 +0200 Subject: [PATCH] Fix releaser in frontend_addon template --- .../.github/workflows/acceptance.yml | 2 +- .../{{ cookiecutter.frontend_addon_name }}/.release-it.json | 3 ++- .../.github/workflows/frontend.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/.github/workflows/acceptance.yml b/frontend_addon/{{ cookiecutter.__folder_name }}/.github/workflows/acceptance.yml index 9edbc64..2549d1f 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/.github/workflows/acceptance.yml +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/.github/workflows/acceptance.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@{{ cookiecutter.__gha_version_checkout }} - - name: Use Node.js + - name: Use Node.js {{ "${{ env.NODE_VERSION }}" }} uses: actions/setup-node@{{ cookiecutter.__gha_version_setup_node }} with: node-version: {{ "${{ env.NODE_VERSION }}" }} diff --git a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json index cdcd359..f1b6bdb 100644 --- a/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json +++ b/frontend_addon/{{ cookiecutter.__folder_name }}/packages/{{ cookiecutter.frontend_addon_name }}/.release-it.json @@ -4,7 +4,8 @@ "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", "pipx run towncrier build --yes --version ${version}", "cp ../../README.md ./ && cp CHANGELOG.md ../../CHANGELOG.md", - "git add ../../CHANGELOG.md" + "python3 -c 'import json; data = json.load(open(\"../../package.json\")); data[\"version\"] = ${version}; json.dump(data, open(\"../../package.json\", \"w\"), indent=2)'", + "git add ../../CHANGELOG.md ../../package.json" ], "after:release": "rm .changelog.draft README.md" }, diff --git a/project/{{ cookiecutter.__folder_name }}/.github/workflows/frontend.yml b/project/{{ cookiecutter.__folder_name }}/.github/workflows/frontend.yml index cfc15c8..e25c777 100644 --- a/project/{{ cookiecutter.__folder_name }}/.github/workflows/frontend.yml +++ b/project/{{ cookiecutter.__folder_name }}/.github/workflows/frontend.yml @@ -29,7 +29,7 @@ jobs: id: vars run: | echo 'BASE_TAG=sha-$(git rev-parse --short HEAD)' >> $GITHUB_OUTPUT - python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"]["tag"])' >> $GITHUB_OUTPUT + python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"].get("tag") or "latest")' >> $GITHUB_OUTPUT - name: Test vars run: | echo 'BASE_TAG={{"${{ steps.vars.outputs.BASE_TAG }}"}}'