-
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
b12e1a9
commit 6795587
Showing
4 changed files
with
75 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
name: Publish Images | ||
name: Publish Images and Release | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
|
@@ -67,10 +67,25 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- id: check | ||
uses: EndBug/version-check@v2 | ||
|
||
with: | ||
diff-search: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# You can use this to make the action use the current version (either from the | ||
# local file or the provided URL, see the `file-url` option) as either the added | ||
# or deleted version. | ||
# Accepted values are 'new' (if you want that version to be the "added" one) and | ||
# 'old' (to make it the "deleted" one). | ||
# Default: '' | ||
# assume-same-version: old | ||
|
||
- name: Generate short tags | ||
id: tags | ||
run: | | ||
script/generate_tags.py | ||
script/generate_tags.py --package-version ${{ steps.check.outputs.version }} --package-version-changed ${{ steps.check.outputs.changed }} | ||
# --suffix "${{ matrix.image.suffix }}" | ||
|
||
- name: Build and push | ||
|
@@ -91,10 +106,38 @@ jobs: | |
BUILD_VERSION=${{ steps.tags.outputs.version }} | ||
BUILD_CHANNEL=${{ steps.tags.outputs.channel }} | ||
outputs: | ||
version: ${{ steps.tags.outputs.version }} | ||
channel: ${{ steps.tags.outputs.channel }} | ||
|
||
create-release: | ||
if: github.repository == 'matchlighter/typedaemon' && github.event_name != 'release' && needs.deploy-docker.outputs.channel == 'release' | ||
needs: [deploy-docker] | ||
permissions: | ||
contents: write | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Generate changelog" | ||
id: changelog | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
tag_name: ${{ needs.deploy-docker.outputs.version }} | ||
target_commitish: ${{ github.ref }} | ||
|
||
outputs: | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
|
||
deploy-ha-addon-repo: | ||
if: github.repository == 'matchlighter/typedaemon' && github.event_name == 'release' | ||
if: ${{ !failure() && github.repository == 'matchlighter/typedaemon' && needs.deploy-docker.outputs.channel == 'release' }} | ||
runs-on: ubuntu-latest | ||
needs: [deploy-docker] | ||
needs: [deploy-docker, create-release] | ||
steps: | ||
- name: Trigger Workflow | ||
uses: actions/github-script@v6 | ||
|
@@ -107,7 +150,7 @@ jobs: | |
workflow_id: "bump-version.yml", | ||
ref: "master", | ||
inputs: { | ||
version: "${{ github.event.release.tag_name }}", | ||
content: ${{ toJSON(github.event.release.body) }} | ||
version: "${{ needs.deploy-docker.outputs.version }}", | ||
content: ${{ toJSON(github.event.release.body || needs.create-release.outputs.body) }} | ||
} | ||
}) |
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
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