-
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 f3af757
Showing
4 changed files
with
51 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,79 @@ 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 | ||
- name: Fetch tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Generate Release Message | ||
id: message | ||
uses: actions/github-script@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
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` : ""; | ||
let message = ''; | ||
await exec.exec(`git log ${diff} --pretty=format:"- %h %s"`, { | ||
listeners: { | ||
stdout: (data) => { message += data.toString(); }, | ||
} | ||
}) | ||
core.setOutput("body", message.trim()); | ||
- 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 }} | ||
body: ${{ steps.message.outputs.body }} | ||
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({ | ||
let content = ${{ toJSON(github.event.release.body) }} || ${{ toJSON(needs.deploy-docker.outputs.body) }}; | ||
if (!content) { | ||
const release_resp = await github.rest.repos.getRelease({ | ||
owner: "matchlighter", | ||
repo: "typedaemon", | ||
release_id: ${{ needs.create-release.outputs.release_id }}, | ||
}); | ||
const release = release_resp.data; | ||
console.log(release); | ||
content = release.body; | ||
} | ||
console.log(content); | ||
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, | ||
} | ||
}) |
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