Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backmerge preview to development #2479

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ${{ matrix.os }}

environment:
name: ${{ startsWith(github.event.ref, 'refs/tags/') && 'main' || startsWith(github.event.ref, 'refs/heads/preview/') && 'previewnet' || 'internal' }}
name: ${{ startsWith(github.event.ref, 'refs/tags/') && 'main' || startsWith(github.event.ref, 'refs/heads/preview/') && 'preview' || 'internal' }}

steps:
- uses: actions/checkout@v3.6.0
Expand Down Expand Up @@ -72,8 +72,20 @@ jobs:
then
sed "s/Please replace it/${{ secrets.APPLE_TEAM_ID }}/g" electron-builder.main.yml > temp2.txt
mv temp2.txt electron-builder.main.yml
elif [[ "${{ startsWith(github.event.ref, 'refs/heads/preview/') }}" == true ]]
then
timestamp=$(date +%y%m%d%H%M%S)
version=$(jq -r .version package.json | awk -F'.' '{print $1"."$2}')
jq --arg version "$version.$timestamp" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json
jq --arg suffix " Preview" '.productName += $suffix' package.json > tmp.$$.json && mv tmp.$$.json package.json
jq --arg suffix "Preview" '.name += $suffix' package.json > tmp.$$.json && mv tmp.$$.json package.json
sed 's/NineChronicles@workspace/NineChroniclesPreview@workspace/g' yarn.lock > temp1.txt
mv temp1.txt yarn.lock
mv ./signing/sandbox_code_sign_tool.properties ./tmp/codesign/conf/code_sign_tool.properties
sed "s/Please replace it/${{ secrets.APPLE_TEAM_ID }}/g" electron-builder.preview.yml > temp2.txt
mv temp2.txt electron-builder.preview.yml
else
timestamp=$(date +%s)
timestamp=$(date +%y%m%d%H%M%S)
version=$(jq -r .version package.json | awk -F'.' '{print $1"."$2}')
jq --arg version "$version.$timestamp" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json
jq --arg suffix " Internal" '.productName += $suffix' package.json > tmp.$$.json && mv tmp.$$.json package.json
Expand Down Expand Up @@ -114,6 +126,11 @@ jobs:
sh ./scripts/release.sh main ${{ matrix.packCmd }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/main/launcher/latest.yml"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/main/launcher/latest-mac.yml"
elif [[ "${{ startsWith(github.event.ref, 'refs/heads/preview/') }}" == true ]]
then
sh ./scripts/release.sh preview ${{ matrix.packCmd }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/main/launcher/latest.yml"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/main/launcher/latest-mac.yml"
else
sh ./scripts/release.sh internal ${{ matrix.packCmd }}
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/internal/launcher/latest.yml"
Expand Down
6 changes: 3 additions & 3 deletions electron-builder.internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ win:
- target: "nsis"
arch:
- "x64"
icon: "app.ico"
icon: "./src/renderer/resources/launcher-icon/internal/app.ico"
nsis:
oneClick: false
perMachine: false
allowElevation: false
allowToChangeInstallationDirectory: true
deleteAppDataOnUninstall: true
mac:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/internal/AppIcon.icns"
target:
- "dmg"
- "zip"
Expand All @@ -30,7 +30,7 @@ mac:
entitlementsInherit: "./signing/entitlements.inherit.plist"
notarize: { teamId: "Please replace it" }
dmg:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/internal/AppIcon.icns"
sign: false
iconSize: 75
contents:
Expand Down
2 changes: 1 addition & 1 deletion electron-builder.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ win:
- "zip"
icon: "app.ico"
mac:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/main/AppIcon.icns"
target:
- "tar.gz"
category: "public.app-category.games"
6 changes: 3 additions & 3 deletions electron-builder.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ win:
- target: "nsis"
arch:
- "x64"
icon: "app.ico"
icon: "./src/renderer/resources/launcher-icon/main/app.ico"
sign: "./scripts/sign.js"
nsis:
oneClick: false
Expand All @@ -20,7 +20,7 @@ nsis:
allowToChangeInstallationDirectory: true
deleteAppDataOnUninstall: true
mac:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/main/AppIcon.icns"
target:
- "dmg"
- "zip"
Expand All @@ -30,7 +30,7 @@ mac:
entitlementsInherit: "./signing/entitlements.inherit.plist"
notarize: { teamId: "Please replace it" }
dmg:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/main/AppIcon.icns"
iconSize: 75
sign: false
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ win:
- target: "nsis"
arch:
- "x64"
icon: "app.ico"
icon: "./src/renderer/resources/launcher-icon/preview/app.ico"
nsis:
oneClick: false
perMachine: false
allowElevation: false
allowToChangeInstallationDirectory: true
deleteAppDataOnUninstall: true
mac:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/preview/AppIcon.icns"
target:
- "dmg"
- "zip"
Expand All @@ -30,7 +30,7 @@ mac:
entitlementsInherit: "./signing/entitlements.inherit.plist"
notarize: { teamId: "Please replace it" }
dmg:
icon: "AppIcon.icns"
icon: "./src/renderer/resources/launcher-icon/preview/AppIcon.icns"
sign: false
iconSize: 75
contents:
Expand All @@ -47,5 +47,5 @@ linux:
publish:
provider: "s3"
bucket: "9c-release.planetariumhq.com"
path: "previewnet/launcher"
path: "preview/launcher"
acl: "private"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"build": "yarn codegen && webpack --env NODE_ENV=development --env target=render && webpack --env NODE_ENV=development --env target=main",
"build-main": "yarn codegen && webpack --env NODE_ENV=production --env target=render --env DEFAULT_NETWORK=main && webpack --env NODE_ENV=production --env target=main --env DEFAULT_NETWORK=main",
"build-internal": "yarn codegen && webpack --env NODE_ENV=production --env target=render --env DEFAULT_NETWORK=internal && webpack --env NODE_ENV=production --env target=main --env DEFAULT_NETWORK=internal",
"build-preview": "yarn codegen && webpack --env NODE_ENV=production --env target=render --env DEFAULT_NETWORK=previewnet && webpack --env NODE_ENV=production --env target=main --env DEFAULT_NETWORK=previewnet",
"build-preview": "yarn codegen && webpack --env NODE_ENV=production --env target=render --env DEFAULT_NETWORK=preview && webpack --env NODE_ENV=production --env target=main --env DEFAULT_NETWORK=preview",
"server": "yarn webpack serve --env NODE_ENV=development --env target=render --hot",
"start": "yarn webpack --env NODE_ENV=development --env target=main && electron ./build/.",
"start:v2": "yarn webpack --env NODE_ENV=development --env target=main && electron ./build/. --v2",
Expand Down
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const gitHash = child_process.execSync("git rev-parse HEAD", {

function createRenderConfig(
isDev: boolean,
DEFAULT_NETWORK: "main" | "internal" | "previewnet",
DEFAULT_NETWORK: "main" | "internal" | "preview",
) {
return {
context: path.join(__dirname, "src"),
Expand Down Expand Up @@ -169,7 +169,7 @@ function createRenderConfig(

function createMainConfig(
isDev: boolean,
DEFAULT_NETWORK: "main" | "internal" | "previewnet",
DEFAULT_NETWORK: "main" | "internal" | "preview",
) {
return {
context: path.join(__dirname, "src"),
Expand Down
Loading