diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29191ad..3b15d0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,32 +14,33 @@ jobs: - uses: actions/checkout@v3 with: ref: main - - name: Parse version + - name: Strip prefix from tag and return version + id: version # weird hassio-addons/repository-updater behaviour # Always creates add-on Readme URL with `v` prefix. E.g. /tree/v*.*.*. so we need tags prefixed with `v` for working add-ons Readme # `v` prefix is always stripped when creating addon config.json in add-ons repo ... so we need to build containers without prefix # Final verdict: tag prefixed with `v`, everything else without prefix => package.json, config.json (version is used for docker build) run: | TAG=${{ github.event.release.tag_name }} - echo "VERSION=${TAG#v}" >> $GITHUB_ENV + echo "version=${TAG#v}" >> $GITHUB_ENV - name: Update root package.json version uses: jossef/action-set-json-field@v2.1 with: file: package.json field: version - value: ${{ VERSION }} + value: ${{ steps.version.outputs.version }} - name: Update laskakit-data-feeder package.json version uses: jossef/action-set-json-field@v2.1 with: file: laskakit-data-feeder/package.json field: version - value: ${{ VERSION }} + value: ${{ steps.version.outputs.version }} - name: Update laskakit-data-feeder addon config.json version uses: jossef/action-set-json-field@v2.1 with: file: laskakit-data-feeder/config.json field: version - value: ${{ VERSION }} + value: ${{ steps.version.outputs.version }} - name: Extract release date from git tag id: release_date run: | @@ -47,13 +48,13 @@ jobs: - name: Update Changelog uses: stefanzweifel/changelog-updater-action@v1 with: - latest-version: ${{ VERSION }} + latest-version: ${{ steps.version.outputs.version }} release-date: ${{ steps.release_date.outputs.date }} release-notes: ${{ github.event.release.body }} - name: Commit and push uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: "chore: Release ${{ VERSION }} [skip ci]" + commit_message: "chore: Release ${{ steps.version.outputs.version }} [skip ci]" publish-docker: name: Publish to Docker Hub