fix: ref_name

This commit is contained in:
chenos 2025-04-18 14:34:11 +08:00
parent a7cefd42d6
commit b170c286f6

View File

@ -5,7 +5,10 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
on: on:
push: workflow_dispatch:
inputs:
ref_name:
description: 'Branch or tag name to release'
jobs: jobs:
get-plugins: get-plugins:
@ -28,10 +31,10 @@ jobs:
id: get-info id: get-info
shell: bash shell: bash
run: | run: |
if [[ "${{ github.ref_name }}" =~ "beta" ]]; then if [[ "${{ inputs.ref_name || github.ref_name }}" =~ "beta" ]]; then
echo "defaultTag=$(echo 'beta')" >> $GITHUB_OUTPUT echo "defaultTag=$(echo 'beta')" >> $GITHUB_OUTPUT
echo "proRepos=$(echo '${{ needs.get-plugins.outputs.beta-plugins }}')" >> $GITHUB_OUTPUT echo "proRepos=$(echo '${{ needs.get-plugins.outputs.beta-plugins }}')" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref_name }}" =~ "alpha" ]]; then elif [[ "${{ inputs.ref_name || github.ref_name }}" =~ "alpha" ]]; then
echo "defaultTag=$(echo 'alpha')" >> $GITHUB_OUTPUT echo "defaultTag=$(echo 'alpha')" >> $GITHUB_OUTPUT
echo "proRepos=$(echo '${{ needs.get-plugins.outputs.alpha-plugins }}')" >> $GITHUB_OUTPUT echo "proRepos=$(echo '${{ needs.get-plugins.outputs.alpha-plugins }}')" >> $GITHUB_OUTPUT
else else
@ -49,7 +52,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: ${{ github.ref_name }} ref: ${{ inputs.ref_name || github.ref_name }}
- name: yarn install - name: yarn install
run: | run: |
yarn install yarn install
@ -58,14 +61,14 @@ jobs:
with: with:
repository: nocobase/pro-plugins repository: nocobase/pro-plugins
path: packages/pro-plugins path: packages/pro-plugins
ref: ${{ github.ref_name }} ref: ${{ inputs.ref_name || github.ref_name }}
token: ${{ steps.app-token.outputs.token }} token: ${{ steps.app-token.outputs.token }}
- name: Clone pro repos - name: Clone pro repos
shell: bash shell: bash
run: | run: |
for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }} ${{ join(fromJSON(needs.get-plugins.outputs.custom-plugins), ' ') }} for repo in ${{ join(fromJSON(steps.get-info.outputs.proRepos), ' ') }} ${{ join(fromJSON(needs.get-plugins.outputs.custom-plugins), ' ') }}
do do
git clone -b ${{ github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo git clone -b ${{ inputs.ref_name || github.ref_name }} https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/nocobase/$repo.git packages/pro-plugins/@nocobase/$repo
done done
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2