Skip to content

Commit adca53d

Browse files
authored
fix #736 (#737)
* version update * api report * Update publish-nightly.yml * Update publish-nightly.yml * Update publish-nightly.yml * Update publish-nightly.yml * Update publish-nightly.yml
1 parent 9a58e05 commit adca53d

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

.github/workflows/publish-nightly.yml

+23-9
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,38 @@ jobs:
99
get-branches:
1010
runs-on: ubuntu-latest
1111
outputs:
12-
branches: ${{ steps.getb.outputs.branches }}
12+
matrix: ${{ steps.getb.outputs.matrix }}
1313
steps:
14+
- name: Checkout
15+
uses: actions/[email protected]
16+
with:
17+
fetch-depth: 0
18+
1419
- id: getb
1520
run: |
16-
branches=[$(git branch -r | grep origin | grep -v '\->' | sed 's/\s*origin\///' | sed 's/^.*$/"&",/')]
17-
echo "branches=$branches" >> $GITHUB_OUTPUT
21+
declare -A branches=(
22+
["dev"]="master"
23+
["next"]="aiscript-next"
24+
)
25+
matrix='{"include":['
26+
sep=""
27+
for tag in "${!branches[@]}"; do
28+
branch=${branches[${tag}]}
29+
if git show-ref --quiet refs/remotes/origin/${branch}; then
30+
matrix="${matrix}${sep}{\"branch\":\"${branch}\",\"tag\":\"${tag}\"}"
31+
sep=","
32+
fi
33+
done
34+
matrix="${matrix}]}"
35+
echo "matrix=$matrix" >> $GITHUB_OUTPUT
1836
1937
2038
publish:
2139
runs-on: ubuntu-latest
40+
needs: get-branches
2241
strategy:
2342
fail-fast: false
24-
matrix:
25-
include:
26-
- branch: master
27-
tag: dev
28-
- branch: aiscript-next
29-
tag: next
43+
matrix: ${{ fromJSON(needs.get-branches.outputs.matrix) }}
3044
env:
3145
NPM_SECRET: ${{ secrets.NPM_SECRET }}
3246
needs: get-branches

0 commit comments

Comments
 (0)