Skip to content

Commit

Permalink
Build type variable
Browse files Browse the repository at this point in the history
  • Loading branch information
luxaritas committed Jul 22, 2024
1 parent 3d2a674 commit f95583c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions: {}
env:
API_DOMAIN: eternagame.org
NODE_VERSION: 18.x
BUILD_TYPE: prod

jobs:
build-eternajs:
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
run: npm ci
working-directory: ./eternajs
- name: Build
run: npm run build
run: npm run build:${{ env.BUILD_TYPE }}
working-directory: ./eternajs
env:
APP_SERVER_URL: https://${{ env.API_DOMAIN }}
Expand All @@ -52,7 +53,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: eternajs
path: ./eternajs/dist/prod
path: ./eternajs/dist/${{ env.BUILD_TYPE }}

build-wrapper:
runs-on: ubuntu-latest
Expand All @@ -74,9 +75,8 @@ jobs:
- name: Install dependencies
run: npm ci --ignore-scripts
- name: build
run: npm run build:prod
run: npm run build:${{ env.BUILD_TYPE }}
env:
NODE_ENV: prod
PARALLEL_BUILD: true
APP_SERVER_URL: https://${{ env.API_DOMAIN }}
INJECT_COOKIE_DOMAIN: .${{ env.API_DOMAIN }}
Expand Down Expand Up @@ -122,7 +122,6 @@ jobs:
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build
run: npx cordova build ${{ matrix.target }} --release --device
run: npx cordova build ${{ matrix.target }} --${{ env.BUILD_TYPE == 'prod' && 'release' || 'debug' }} --device
env:
NODE_ENV: prod
PARALLEL_BUILD: true
2 changes: 1 addition & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const MAX_LEVEL = 8;

export default function createStore(http: AxiosInstance) {
return new Vuex.Store({
strict: process.env.NODE_ENV !== 'production',
strict: process.env.NODE_ENV !== 'prod',
state: {
isLoadingCount: 0,
loggedIn: false,
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ module.exports = function(mode, eternajs_copy) {
...(process.env.PARALLEL_BUILD ? [] : [{ context: eternajs_copy, from: '**/*', to: 'eternajs/'}]),
{ from: 'src/assets/favicon.ico', to: 'favicon.ico'},
]}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(mode)
})
],
};
};

0 comments on commit f95583c

Please sign in to comment.