forked from hugcabbage/shared-lede
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (70 loc) · 1.83 KB
/
refresh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: refresh
on:
workflow_dispatch:
inputs:
deploydir:
description: 'file(s) directory'
required: true
type: string
default: 'preset-main'
configls:
description: '<serial>.config file(s)'
required: true
type: string
default: '1.config, 2.config, 3.config'
env:
FILEDIR: ${{ inputs.deploydir }}
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
filels: ${{ steps.set-matrix.outputs.configls }}
steps:
- id: set-matrix
env:
CONFIGLS: ${{ inputs.configls }}
run: |
NEW=${CONFIGLS//' '/''}; NEW=${NEW//','/' '}; NEW=($NEW)
array=""
for item in ${NEW[@]}
do
array=$array'"'$item'",'
done
echo "configls=[$array]" >> $GITHUB_OUTPUT
refresh:
needs: set-matrix
runs-on: ubuntu-latest
env:
FILE: ${{ matrix.file }}
strategy:
matrix:
file: ${{ fromJSON(needs.set-matrix.outputs.filels) }}
steps:
- uses: actions/checkout@v3
- name: carry out
run: python3 templet/refresh.py
- uses: actions/upload-artifact@v3
with:
name: ${{ env.FILE }}
path: ${{ env.FILEDIR }}/${{ env.FILE }}*
commit:
needs: refresh
runs-on: ubuntu-latest
env:
ARTIFACTDIR: dlfiles
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: ${{ env.ARTIFACTDIR }}
- uses: geekyeggo/delete-artifact@v2
with:
name: '*'
- name: move files
run: |
python3 templet/refreshmv.py
rm -rf $ARTIFACTDIR
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: .config files refreshed
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>