Skip to content

Commit 7fca42e

Browse files
authored
Merge dev to master (#288)
Bring Release 4.x to masterbranch
2 parents 4aefd8e + 967fb29 commit 7fca42e

38 files changed

+3930
-2572
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/FHEM/trunk
2+
.github
3+
.vscode
4+
.cache

.github/workflows/build.yml

Lines changed: 535 additions & 268 deletions
Large diffs are not rendered by default.

.github/workflows/cacheCleanup.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: cleanup caches by a branch / PR
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
workflow_dispatch:
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# `actions:write` permission is required to delete caches
13+
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
14+
actions: write
15+
contents: read
16+
steps:
17+
- name: Cleanup
18+
run: |
19+
gh extension install actions/gh-actions-cache
20+
21+
REPO=${{ github.repository }}
22+
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
23+
24+
echo "Fetching list of cache key"
25+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
26+
27+
## Setting this to not fail the workflow while deleting cache keys.
28+
set +e
29+
echo "Deleting caches..."
30+
for cacheKey in $cacheKeysForPR
31+
do
32+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
33+
done
34+
echo "Done"
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/prepare-docker/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ runs:
3838
uses: docker/setup-buildx-action@v3
3939

4040
- name: Login to DockerHub
41-
if: github.event_name != 'pull_request' && inputs.DOCKER_HUB_USERNAME != null && inputs.DOCKER_HUB_ACCESS_TOKEN != null
41+
if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'publishImage') ) && inputs.DOCKER_HUB_USERNAME != null && inputs.DOCKER_HUB_ACCESS_TOKEN != null
4242
uses: docker/login-action@v3
4343
with:
4444
username: ${{ inputs.DOCKER_HUB_USERNAME }}
4545
password: ${{ inputs.DOCKER_HUB_ACCESS_TOKEN }}
4646

4747
- name: Login to GitHub Container Registry
48-
if: github.event_name != 'pull_request' && inputs.GHCR_OWNER != null && inputs.GHCR_ACCESS_TOKEN != null
48+
if: (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'publishImage') ) && inputs.GHCR_OWNER != null && inputs.GHCR_ACCESS_TOKEN != null
4949
uses: docker/login-action@v3
5050
with:
5151
registry: ghcr.io
Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
name: Reusable composit workflow which prepares svn
2-
description: pull svn remote, extract svn ref and latest tag
3-
outputs:
4-
VARIANT_FHEM:
5-
description: "Combined string, with FHEM Version and latest svn commit id"
6-
value: ${{ steps.svnVars.outputs.VARIANT_FHEM }}
7-
FHEM_REVISION_LATEST:
8-
description: "The revision Number pulled from SVN"
9-
value: ${{ steps.svnVars.outputs.FHEM_REVISION_LATEST }}
10-
11-
12-
runs:
13-
using: "composite"
14-
steps:
15-
- name: Get latest svn revision from remote server
16-
shell: bash
17-
id: svnRemote
18-
run: echo "LAST_SVN_REVISION=$( svn info --show-item revision https://svn.fhem.de/fhem/trunk )" >> $GITHUB_OUTPUT
19-
20-
- name: Cache fhem
21-
id: cache-fhem
22-
uses: actions/cache@v4
23-
with:
24-
path: ./src/fhem/trunk
25-
key: ${{ runner.os }}-fhemsvn-${{ steps.svnRemote.outputs.LAST_SVN_REVISION }}
26-
restore-keys: |
27-
${{ runner.os }}-fhemsvn-
28-
29-
- name: Update or checkout fhem from svn
30-
shell: bash
31-
if: steps.cache-fhem.outputs.cache-hit != 'true'
32-
run: svn update ./src/fhem/trunk/ || svn co https://svn.fhem.de/fhem/trunk ./src/fhem/trunk;
33-
34-
- name: prepare svn vars
35-
shell: bash
36-
id: svnVars
37-
working-directory: ./src/fhem/trunk
38-
run: |
39-
FHEM_REVISION_LATEST=$( svn info --show-item last-changed-revision)
40-
FHEM_VERSION=$( svn ls "^/tags" https://svn.fhem.de/fhem/ | grep "FHEM_" | sort | tail -n 1 | cut -d / -f 1 | cut -d " " -f 1 |cut -d _ -f 2- | sed s/_/./g )
41-
echo "VARIANT_FHEM=$(echo "${FHEM_VERSION}-s${FHEM_REVISION_LATEST}")" >> $GITHUB_OUTPUT
42-
echo "FHEM_REVISION_LATEST=$(echo "$FHEM_REVISION_LATEST")" >> $GITHUB_OUTPUT
1+
name: Reusable composit workflow which prepares svn
2+
description: pull svn remote, extract svn ref and latest tag
3+
outputs:
4+
VARIANT_FHEM:
5+
description: "Combined string, with FHEM Version and latest svn commit id"
6+
value: ${{ steps.svnVars.outputs.VARIANT_FHEM }}
7+
FHEM_REVISION_LATEST:
8+
description: "The revision Number pulled from SVN"
9+
value: ${{ steps.svnVars.outputs.FHEM_REVISION_LATEST }}
10+
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: install svn
16+
shell: bash
17+
run: sudo apt-get install -y subversion
18+
- name: Get latest svn revision from remote server
19+
shell: bash
20+
id: svnRemote
21+
run: echo "LAST_SVN_REVISION=$( svn info --show-item revision https://svn.fhem.de/fhem/trunk )" >> $GITHUB_OUTPUT
22+
23+
- name: Cache fhem
24+
id: cache-fhem
25+
uses: actions/cache@v4
26+
with:
27+
path: ./src/fhem/trunk
28+
key: ${{ runner.os }}-fhemsvn-${{ steps.svnRemote.outputs.LAST_SVN_REVISION }}
29+
restore-keys: |
30+
${{ runner.os }}-fhemsvn-
31+
32+
- name: Update or checkout fhem from svn
33+
shell: bash
34+
if: steps.cache-fhem.outputs.cache-hit != 'true'
35+
run: svn update ./src/fhem/trunk/ || svn co https://svn.fhem.de/fhem/trunk ./src/fhem/trunk;
36+
37+
- name: prepare svn vars
38+
shell: bash
39+
id: svnVars
40+
working-directory: ./src/fhem/trunk
41+
run: |
42+
FHEM_REVISION_LATEST=$( svn info --show-item last-changed-revision)
43+
FHEM_VERSION=$( svn ls "^/tags" https://svn.fhem.de/fhem/ | grep "FHEM_" | sort | tail -n 1 | cut -d / -f 1 | cut -d " " -f 1 |cut -d _ -f 2- | sed s/_/./g )
44+
echo "VARIANT_FHEM=$(echo "${FHEM_VERSION}-s${FHEM_REVISION_LATEST}")" >> $GITHUB_OUTPUT
45+
echo "FHEM_REVISION_LATEST=$(echo "$FHEM_REVISION_LATEST")" >> $GITHUB_OUTPUT

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ fhem/backup/*
55
fhem/cache/*
66
fhem/log/*
77
fhem/restoreDir/*
8+
.vscode/*
9+
src/FHEM/trunk/*
10+
.cache/*

.travis_old.yml

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)