From adca53da87c5649aec3e54c90dd31b807b37bc64 Mon Sep 17 00:00:00 2001 From: FineArchs <133759614+FineArchs@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:43:44 +0900 Subject: [PATCH] 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 --- .github/workflows/publish-nightly.yml | 32 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-nightly.yml b/.github/workflows/publish-nightly.yml index 46172cfd..5d9973ca 100644 --- a/.github/workflows/publish-nightly.yml +++ b/.github/workflows/publish-nightly.yml @@ -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