diff --git a/.github/actions/setup-version/action.yml b/.github/actions/setup-version/action.yml index a006e13977..cde7873595 100644 --- a/.github/actions/setup-version/action.yml +++ b/.github/actions/setup-version/action.yml @@ -7,8 +7,14 @@ outputs: runs: using: 'composite' steps: - - name: 'Get Version' + - name: 'Write Version' id: version shell: bash run: | - APP_VERSION=$(node -p "require('./package.json').version") + if [ "${{ github.ref_type }}" == "tag" ]; then + APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//') + else + APP_VERSION=$(node -p "require('./package.json').version") + fi + echo $APP_VERSION + echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c822ca2cd..75b31290e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,16 +3,6 @@ name: Build on: push: workflow_dispatch: - inputs: - build-type: - description: 'Build Type' - type: choice - required: true - default: canary - options: - - internal - - beta - - stable env: VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} @@ -20,7 +10,7 @@ env: VITE_IMGPROXY_URL: ${{ vars.VITE_IMGPROXY_URL }} VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }} VITE_POSTHOG_KEY: ${{ vars.VITE_POSTHOG_KEY }} - VITE_BUILD_TYPE: ${{ github.event.inputs.build-type || 'internal' }} + VITE_BUILD_TYPE: internal jobs: release: @@ -116,7 +106,7 @@ jobs: uses: ./.github/actions/setup-version - name: Create Release Draft - if: github.event_name == 'workflow_dispatch' + if: github.ref_type == 'tag' uses: softprops/action-gh-release@v2 with: name: v${{ steps.version.outputs.APP_VERSION }}