Skip to content

Commit

Permalink
Merge pull request #53 from Snuffy2/Github-Actions-Update
Browse files Browse the repository at this point in the history
Github Actions Update
  • Loading branch information
prestomation authored Aug 27, 2024
2 parents 130ecf4 + e253b39 commit b887a93
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 118 deletions.
29 changes: 13 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
labels:
- "pr: dependency-update"
schedule:
interval: daily
time: "06:00"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
14 changes: 9 additions & 5 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@ name-template: "$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
sort-direction: ascending
exclude-labels:
- "ignore-for-release"
- "dependencies"
autolabeler:
- label: "chore"
title:
- "/chore:/i"
- "/chore/i"
- label: "bugfix"
title:
- "/fix:/i"
- "/fix/i"
- label: "feature"
title:
- "/feat:/i"
- "/feat/i"
- label: "enhancement"
title:
- "/refactor:/i"
- "/refactor/i"
- label: "code-quality"
title:
- "/tests:/i"
- "/tests/i"
categories:
- title: ":boom: Breaking Change :boom:"
labels:
Expand All @@ -36,6 +39,7 @@ categories:
- title: ":wrench: Maintenance :wrench:"
labels:
- "chore"
- "github_actions"
- title: ":mortar_board: Code Quality :mortar_board:"
labels:
- "code-quality"
Expand Down
1 change: 1 addition & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ changelog:
exclude:
labels:
- ignore-for-release
- dependencies
authors:
- octocat
categories:
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/cron.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/pull.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ on:
push:
branches:
- master
- main
- dev
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Debug Variables
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.workspace: ${{ github.workspace }}"
echo "github.event.repository.default_branch: ${{ github.event.repository.default_branch }}"
echo "github.event.release.target_commitish: ${{ github.event.release.target_commitish }}"
echo "github.event.release.prerelease: ${{ github.event.release.prerelease }}"
echo "github.event.release.draft: ${{ github.event.release.draft }}"
- name: "Set version number"
run: |
sed -i '/VERSION = /c\VERSION = "${{ steps.get_version.outputs.VERSION }}"' ${{ github.workspace }}/custom_components/resmed_myair/const.py
sed -i '/version/c\ \"version\": \"${{ steps.get_version.outputs.VERSION }}\"' ${{ github.workspace }}/custom_components/resmed_myair/manifest.json
sed -i 's/\"version\"\s*\:\s*\".*\"/\"version\"\:\"${{ github.ref_name }}\"/g' ${{ github.workspace }}/custom_components/resmed_myair/manifest.json
sed -i 's/VERSION\s*\=\s*\".*\"/VERSION \= \"${{ github.ref_name }}\"/' ${{ github.workspace }}/custom_components/resmed_myair/const.py
# Pack the resmed_myair dir as a zip and upload to the release
- name: ZIP Component Dir
run: |
Expand Down
40 changes: 24 additions & 16 deletions .github/workflows/push.yml → .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
name: Push actions
name: Validation Actions

on:
pull_request:
push:
branches:
- master
- main
- dev
workflow_dispatch:

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands
- name: Debug Variables
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.event.repository.default_branch: ${{ github.event.repository.default_branch }}"
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"

style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .

tests:
runs-on: "ubuntu-latest"
Expand All @@ -42,7 +50,7 @@ jobs:
- name: Setup Python
uses: "actions/setup-python@v5"
with:
python-version: "3.11"
python-version: "3.12"
- name: Install requirements
run: python3 -m pip install -r requirements_test.txt
- name: Run tests
Expand Down

0 comments on commit b887a93

Please sign in to comment.