Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sidmorizon committed Jan 10, 2025
1 parent 171569e commit 168bd20
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ EXT_INJECT_MODE=
# for hardware-js-sdk iframe src
HARDWARE_SDK_CONNECT_SRC=

# for webpack analyzer
ENABLE_ANALYZER=
ENABLE_ANALYZER_HTML_REPORT=

# Jpush
JPUSH_KEY=
JPUSH_CHANNEL=
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ on:
workflow_dispatch:

jobs:
shared-env:
uses: ./.github/workflows/shared-env.yml
secrets: inherit
with:
env_file_name: ".env"
sentry_project: 'chrome-extension'

release-ext:
needs: shared-env
runs-on: macos-latest
strategy:
matrix:
Expand All @@ -29,6 +21,12 @@ jobs:
uses: actions/checkout@v3
with:
lfs: true

- name: Run shared env setup
uses: ./.github/workflows/shared-env.yml
with:
env_file_name: ".env"
sentry_project: 'chrome-extension'

- name: Download ENV file
uses: actions/download-artifact@v3
Expand Down
49 changes: 22 additions & 27 deletions .github/workflows/shared-env.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
name: Shared Environment Variables
name: Shared Environment Variables Setup
description: Setup environment variables for the project

on:
workflow_call:
inputs:
additional_env:
required: false
type: string
description: "Additional environment variables to inject"
env_file_name:
required: false
type: string
default: ".env"
description: "Target environment file name"
sentry_project:
required: false
type: string
default: ''
description: "Sentry project name"
jobs:
inject-env:
runs-on: ubuntu-latest

inputs:
additional_env:
required: false
type: string
description: "Additional environment variables to inject"
env_file_name:
required: false
type: string
default: ".env"
description: "Target environment file name"
sentry_project:
required: false
type: string
default: ''
description: "Sentry project name"


runs:
using: "composite"
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
Expand Down Expand Up @@ -86,9 +87,3 @@ jobs:
if [[ ! -z "${{ inputs.additional_env }}" ]]; then
echo "${{ inputs.additional_env }}" >> ${TARGET_ENV_FILE}
fi
- name: Upload ENV file
uses: actions/upload-artifact@v3
with:
name: env-file
path: ${{ inputs.env_file_name || '.env' }}

0 comments on commit 168bd20

Please sign in to comment.