-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6795587
commit ef67fd8
Showing
4 changed files
with
33 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ test_setup/ | |
experiments/ | ||
dist/ | ||
.git/ | ||
.github/ | ||
.gitignore | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ jobs: | |
# target: "lint" | ||
# baseimg: "docker" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -69,7 +69,6 @@ jobs: | |
|
||
- id: check | ||
uses: EndBug/version-check@v2 | ||
|
||
with: | ||
diff-search: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -115,42 +114,61 @@ jobs: | |
needs: [deploy-docker] | ||
permissions: | ||
contents: write | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Generate changelog" | ||
id: changelog | ||
uses: heinrichreimer/[email protected] | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-tags: true | ||
- name: Generate Release Message | ||
id: message | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} | ||
script: | | ||
const last_release_resp = await github.rest.repos.getLatestRelease({ | ||
owner: "matchlighter", | ||
repo: "typedaemon", | ||
}); | ||
const last_release = last_release_resp?.data; | ||
const diff = last_release ? `refs/tags/${last_release.tag_name}..HEAD` : ""; | ||
const message = await exec.exec(`git log ${diff} --pretty=format:"- %h %s"`) | ||
core.setOutput("body", message); | ||
- name: Release | ||
id: release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
body: ${{ steps.message.outputs.body }} | ||
tag_name: ${{ needs.deploy-docker.outputs.version }} | ||
target_commitish: ${{ github.ref }} | ||
prerelease: ${{ needs.deploy-docker.outputs.channel != 'release' }} | ||
|
||
outputs: | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
release_id: ${{ steps.release.outputs.id }} | ||
|
||
deploy-ha-addon-repo: | ||
if: ${{ !failure() && github.repository == 'matchlighter/typedaemon' && needs.deploy-docker.outputs.channel == 'release' }} | ||
runs-on: ubuntu-latest | ||
needs: [deploy-docker, create-release] | ||
steps: | ||
- name: Trigger Workflow | ||
uses: actions/github-script@v6 | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} | ||
script: | | ||
github.rest.actions.createWorkflowDispatch({ | ||
const release = await github.rest.repos.getRelease({ | ||
owner: "matchlighter", | ||
repo: "typedaemon", | ||
${{ needs.create-release.outputs.release_id }}, | ||
}); | ||
await github.rest.actions.createWorkflowDispatch({ | ||
owner: "matchlighter", | ||
repo: "typedaemon-hassio", | ||
workflow_id: "bump-version.yml", | ||
ref: "master", | ||
inputs: { | ||
version: "${{ needs.deploy-docker.outputs.version }}", | ||
content: ${{ toJSON(github.event.release.body || needs.create-release.outputs.body) }} | ||
content: ${{ toJSON(github.event.release.body) }} || release.body, | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters