|
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 |
0 commit comments