-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add release-drafter and try releasing
- Loading branch information
Showing
5 changed files
with
118 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name-template: "v$RESOLVED_VERSION 🌈" | ||
tag-template: "v$RESOLVED_VERSION" | ||
sort-direction: ascending | ||
categories: | ||
- title: "⚠ Breaking changes" | ||
label: "breaking change" | ||
- title: "🚀 Features" | ||
labels: | ||
- "feature" | ||
- title: "🔧 Code enhancements" | ||
labels: | ||
- "enhancement" | ||
- title: "🐛 Bug Fixes" | ||
labels: | ||
- "fix" | ||
- "bugfix" | ||
- "bug" | ||
- title: "🈵 Translations" | ||
label: "translation" | ||
- title: "📄 Documentation" | ||
label: "documentation" | ||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)" | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
template: | | ||
$CHANGES |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""Update the manifest file.""" | ||
|
||
# pylint: skip-file | ||
|
||
import json | ||
import os | ||
import sys | ||
|
||
|
||
def update_manifest(): | ||
"""Update the manifest file.""" | ||
version = "v0.0.0" | ||
for index, value in enumerate(sys.argv): | ||
if value in ["--version", "-V"]: | ||
version = sys.argv[index + 1] | ||
|
||
version_striped = version.replace("v", "") | ||
|
||
print("Version number being inserted: " + str(version_striped)) | ||
|
||
print("Opening file...") | ||
|
||
with open(f"{os.getcwd()}/custom_components/amc_alarm/manifest.json") as manifestfile: | ||
manifest = json.load(manifestfile) | ||
|
||
manifest["version"] = version_striped | ||
|
||
print("Manifest file after inserting new version number:") | ||
print(manifest) | ||
|
||
print("Saving file...") | ||
|
||
with open( | ||
f"{os.getcwd()}/custom_components/amc_alarm/manifest.json", "w" | ||
) as manifestfile: | ||
manifestfile.write(json.dumps(manifest, indent=4, sort_keys=True)) | ||
|
||
print("Done!") | ||
|
||
|
||
update_manifest() |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Draft a release note | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
draft_release: | ||
name: Release Drafter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run release-drafter | ||
uses: release-drafter/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release_zip_file: | ||
name: Prepare release asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get version | ||
id: version | ||
uses: home-assistant/actions/helpers/version@master | ||
|
||
- name: "Set version number" | ||
run: | | ||
python3 ${{ github.workspace }}/.github/scripts/update_manifest.py --version ${{ steps.version.outputs.version }} | ||
- name: Create zip | ||
run: | | ||
cd custom_components/amc_alarm | ||
zip amc_alarm.zip -r ./ | ||
- name: Upload zip to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./custom_components/amc_alarm/amc_alarm.zip | ||
asset_name: amc_alarm.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true |
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,4 +1,6 @@ | ||
{ | ||
"name": "AMC Alarm", | ||
"render_readme": true | ||
"render_readme": true, | ||
"zip_release": true, | ||
"filename": "amc_alarm.zip" | ||
} |