Skip to content

Commit

Permalink
Changelog redefinition support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sominemo committed Apr 8, 2020
1 parent 5af82f2 commit 763c0b7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ jobs:
- name: Build
env:
PRERELEASE: "${{ github.event.release.prerelease }}"
CHANGELOG: ${{ github.event.release.html_url }}
run: |
if [[ $PRERELEASE == "true" ]]; then yarn run wg; else yarn run build; fi
if [[ $PRERELEASE == "true" ]]; then yarn run wg --env.CHANGELOG="$CHANGELOG"; else yarn run build; fi
- name: Test
run: |
yarn test
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mono-pwa",
"version": "4.0.0-dev2",
"version": "4.0.0-dev.2",
"description": "monobank PWA",
"main": "index.html",
"config": {
Expand Down
5 changes: 3 additions & 2 deletions src/app/modules/mono/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import SettingsStorage from "@Core/Services/Settings/SettingsStorage"
import Sleep from "@Core/Tools/objects/sleep"
import { ContextMenu } from "@Environment/Library/DOM/elements"
import Auth from "./services/Auth"
import PWA from "../main/PWA"

const lastChangelog = {
version: "4.0.0-dev1",
version: PWA.version,
get link() {
return `https://sominemo.com/mono/help/release/${LanguageCore.language.info.code}/${this.version}`
return PWA.changelog || `https://sominemo.com/mono/help/release/${LanguageCore.language.info.code}/${this.version}`
},
}

Expand Down
14 changes: 9 additions & 5 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const PATHS = {
public: "https://mono.sominemo.com/",
}

const trustedOrigins = [
"https://wg.mono.sominemo.com",
"https://mono.sominemo.com",
]

PATHS.app = path.join(PATHS.source, "app")
PATHS.core = path.join(PATHS.source, "core")
PATHS.environment = path.join(PATHS.source, "environment")
Expand All @@ -40,8 +45,6 @@ PATHS.themes = [
path.join(PATHS.resources, "styles", "themes"),
]

// Own scripts

if (!fs.existsSync(PATHS.generated)) {
fs.mkdirSync(PATHS.generated)
}
Expand Down Expand Up @@ -71,10 +74,11 @@ const resolveAlias = {

module.exports = (env = {}) => {
const PROD = !!env.PRODUCTION
const CHANGELOG = env.CHANGELOG || null
PATHS.build = (env.LOCAL ? PATHS.localBuild : (env.WG ? PATHS.wgBuild : PATHS.build))
const ANALYTICS_TAG = (env.ANALYTICS ? (!env.WG ? "G-81RB2HPF8X" : "G-PEX3Q03WQ6") : null)

if(PROD) console.log("-- PRODUCTION BUILD --")
if (PROD) console.log("-- PRODUCTION BUILD --")

if (env.watch && !env.CI) {
const cb = () => {
Expand All @@ -97,12 +101,12 @@ module.exports = (env = {}) => {
__PACKAGE_VERSION_NUMBER: JSON.stringify(builder.pack.version),
__PACKAGE_BRANCH: JSON.stringify((env.WG ? "workgroup" : builder.pack.config.branch)),
__PACKAGE_BUILD_TIME: webpack.DefinePlugin.runtimeValue(() => JSON.stringify(fecha.format(new Date(), "DD.MM.YYYY HH:mm:ss")), true),
__PACKAGE_CHANGELOG: JSON.stringify([]),
__PACKAGE_CHANGELOG: JSON.stringify(CHANGELOG),
__PACKAGE_WG: JSON.stringify(!!env.WG),
__PACKAGE_ANALYTICS: JSON.stringify(ANALYTICS_TAG),
__PACKAGE_DOWNLOADABLE_LANG_PACKS: JSON.stringify(!!DOWNLOAD_LANG_PACKS),
__MCC_CODES_EMOJI: JSON.stringify(mccEmojiMap),
__TRUSTED_ORIGINS: JSON.stringify(["https://wg.mono.sominemo.com", "https://mono.sominemo.com"]),
__TRUSTED_ORIGINS: JSON.stringify(trustedOrigins),
})

const appConfig = {
Expand Down

0 comments on commit 763c0b7

Please sign in to comment.