Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Feb 15, 2021
1 parent eb10486 commit 113cc30
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 15 deletions.
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: limych
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: #
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: [
"https://sochain.com/a/mjz640g"
]
3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<!--
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
Please note, ANY pull requests to MASTER BRANCH will be CLOSED.
Use develop branch instead.
-->
## Breaking change
<!--
Expand Down
4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 14
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
#daysUntilClose: 7
# Issues with these labels will never be considered stale
#exemptLabels:
# - pinned
# - security
# Label to use when marking an issue as stale
staleLabel: Stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >-
This issue has been automatically marked as stale because it has not had
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/hassfest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Validate with hassfest

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: home-assistant/actions/hassfest@master
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

- working-directory: ./custom_components
run: |
echo "::set-env name=package::`ls -F | grep \/$ | sed -n "s/\///g;1p"`"
echo "::set-env name=release_version::`git describe --abbrev=0 | sed s/v//`"
echo "package=`ls -F | grep \/$ | sed -n "s/\///g;1p"`" >> $GITHUB_ENV
echo "release_version=`git describe --abbrev=0 | sed s/v//`" >> $GITHUB_ENV
- working-directory: ./custom_components
run: |
echo "::set-env name=basedir::`pwd`/${{ env.package }}"
echo "basedir=`pwd`/${{ env.package }}" >> $GITHUB_ENV
- name: "Setup Git"
run: |
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ repos:
stages: [manual]
- id: check-json
- id: trailing-whitespace
- id: no-commit-to-branch
args:
- --branch=master
# - id: no-commit-to-branch
# args:
# - --branch=master
- repo: local
hooks:
# Run mypy through our wrapper script in order to get the possible
Expand Down
14 changes: 10 additions & 4 deletions bin/gen_releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import subprocess
from datetime import datetime
from typing import List

from github import Github, Repository, Tag
from github import Github, Repository, Tag, GithubException
from packaging.version import Version

# http://docs.python.org/2/howto/logging.html#library-config
Expand All @@ -19,7 +19,7 @@ logging.basicConfig(level=logging.CRITICAL)

_LOGGER = logging.getLogger(__name__)

VERSION = "1.1.1"
VERSION = "1.1.2"

ROOT = os.path.dirname(os.path.abspath(f"{__file__}/.."))

Expand All @@ -39,8 +39,14 @@ NOCHANGE = "_No changes in this release._"

def get_commits(repo: Repository, since: datetime, until: datetime):
"""Get commits in repo."""
develop_sha = repo.get_branch("develop").commit.sha
commits = repo.get_commits(sha=develop_sha, since=since, until=until)
commits = repo.get_commits(since=since, until=until)
try:
dev = repo.get_branch("develop")
dev_commits = repo.get_commits(sha=dev.commit.sha, since=since, until=until)
if len(dev_commits) > len(commits):
commits = dev_commits
except GithubException:
pass
if len(list(commits)) == 1:
return []
return reversed(list(commits)[:-1])
Expand Down
17 changes: 17 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
# Resolve all dependencies that the application requires to run.

# Stop on errors
set -e

ROOT="$( cd "$( dirname "$(readlink -f "$0")" )/.." >/dev/null 2>&1 && pwd )"

cd "${ROOT}"

if [ -z $1 ]; then
echo "Please, describe version number as first argument."
exit 1
fi

git tag -a "$1" -m "v$1"
echo "Commit tagged as v$1"

0 comments on commit 113cc30

Please sign in to comment.