Skip to content

Commit

Permalink
ci: fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslavirha committed Jun 7, 2023
1 parent 96269c6 commit 84c83c8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,47 @@ 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/[email protected]
with:
file: package.json
field: version
value: ${{ VERSION }}
value: ${{ steps.version.outputs.version }}
- name: Update laskakit-data-feeder package.json version
uses: jossef/[email protected]
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/[email protected]
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: |
echo "date=$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')" >> $GITHUB_OUTPUT;
- 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
Expand Down

0 comments on commit 84c83c8

Please sign in to comment.