Skip to content

Commit

Permalink
chore: fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 11, 2024
1 parent ef65c42 commit 7c597e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
10 changes: 8 additions & 2 deletions .github/actions/setup-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,14 @@ 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 }}
VITE_API_URL: ${{ vars.VITE_API_URL }}
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:
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 7c597e1

Please sign in to comment.