diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml index fdd3b6c2..e795d2ed 100644 --- a/.github/workflows/release-app.yml +++ b/.github/workflows/release-app.yml @@ -36,18 +36,22 @@ jobs: fi current_version=$(jq -r '.version' "$package_file") - current_version="console-${{inputs.app}}/v$current_version" - if ! git rev-parse "$current_version" >/dev/null 2>&1; then + if [ "${{ inputs.app }}" = "deploy-web" ]; then + current_version="console-web/v$current_version" + elif [ "${{ inputs.app }}" = "api" ]; then + current_version="console-api/v$current_version" + else + echo "Error: Unsupported app type '${{ inputs.app }}'." + exit 1 + fi + + has_tag=$(git rev-parse "$current_version" >/dev/null 2>&1 && echo "true" || echo "false") + + if [ "$has_tag" = "false" ]; then echo "version=$current_version" >> $GITHUB_OUTPUT fi - - name: Echo the version and changelog - run: | - echo "---- version start ----" - echo "${{ steps.bumps.outputs.version }}" - echo "---- version end ----" - - name: Create Release if: ${{ steps.bumps.outputs.version != '' }} id: create_release diff --git a/.github/workflows/release-console-web.yml b/.github/workflows/release-console-web.yml new file mode 100644 index 00000000..ee5d7c57 --- /dev/null +++ b/.github/workflows/release-console-web.yml @@ -0,0 +1,19 @@ +name: Draft Api Release + +on: + push: + branches: + - main + paths: + - 'apps/deploy-web/package.json' + +permissions: + contents: write + +jobs: + release: + name: Create Release Draft + uses: ./.github/workflows/release-app.yml + secrets: inherit + with: + app: deploy-web \ No newline at end of file