Skip to content

Commit

Permalink
fix #736 (#737)
Browse files Browse the repository at this point in the history
* version update

* api report

* Update publish-nightly.yml

* Update publish-nightly.yml

* Update publish-nightly.yml

* Update publish-nightly.yml

* Update publish-nightly.yml
  • Loading branch information
FineArchs authored Jul 30, 2024
1 parent 9a58e05 commit adca53d
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/publish-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,38 @@ jobs:
get-branches:
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.getb.outputs.branches }}
matrix: ${{ steps.getb.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0

- id: getb
run: |
branches=[$(git branch -r | grep origin | grep -v '\->' | sed 's/\s*origin\///' | sed 's/^.*$/"&",/')]
echo "branches=$branches" >> $GITHUB_OUTPUT
declare -A branches=(
["dev"]="master"
["next"]="aiscript-next"
)
matrix='{"include":['
sep=""
for tag in "${!branches[@]}"; do
branch=${branches[${tag}]}
if git show-ref --quiet refs/remotes/origin/${branch}; then
matrix="${matrix}${sep}{\"branch\":\"${branch}\",\"tag\":\"${tag}\"}"
sep=","
fi
done
matrix="${matrix}]}"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs: get-branches
strategy:
fail-fast: false
matrix:
include:
- branch: master
tag: dev
- branch: aiscript-next
tag: next
matrix: ${{ fromJSON(needs.get-branches.outputs.matrix) }}
env:
NPM_SECRET: ${{ secrets.NPM_SECRET }}
needs: get-branches
Expand Down

0 comments on commit adca53d

Please sign in to comment.