Skip to content

Commit

Permalink
Merge pull request #4 from radoslavirha/release
Browse files Browse the repository at this point in the history
ci: test release drafter
  • Loading branch information
radoslavirha authored Oct 3, 2023
2 parents bd5d3eb + 3b64f73 commit f8f6eb8
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'Release $RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Publish

on:
release:
types:
- published

jobs:
update-versions-changelog:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Strip prefix from tag and return version
id: version
run: |
TAG=${{ github.event.release.tag_name }}
echo "version=${TAG}" >> "$GITHUB_OUTPUT"
- name: Echo version
run: |
echo ${{ steps.version.outputs.version }}
# - name: Update root package.json version
# uses: jossef/action-set-json-field@v2.1
# with:
# file: package.json
# field: 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: ${{ 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: ${{ 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: ${{ 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 ${{ steps.version.outputs.version }} [skip ci]"

# publish-docker:
# name: Publish to Docker Hub
# runs-on: ubuntu-latest
# needs:
# - update-versions-changelog
# steps:
# - uses: actions/checkout@v3
# with:
# ref: main
# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Publish to Docker Hub
# uses: home-assistant/builder@master
# with:
# args: |
# --all \
# --target laskakit-data-feeder \
# --docker-hub ${{ secrets.DOCKERHUB_USERNAME }}

# update-add-ons-repository:
# name: 📢 Publish Add-on in Homeassistant
# runs-on: ubuntu-latest
# needs:
# - publish-docker
# steps:
# - name: 🚀 Dispatch Repository Updater update signal
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.HA_DISPATCH_TOKEN }}
# repository: radoslavirha/homeassistant-addons
# event-type: update
# client-payload: '{"addon": "laskakit-data-feeder"}'

0 comments on commit f8f6eb8

Please sign in to comment.