Skip to content

Commit

Permalink
release를 위한 준비
Browse files Browse the repository at this point in the history
  • Loading branch information
young-do committed Aug 21, 2024
1 parent 803c0c5 commit 169e745
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 4 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release
on:
push:
branches:
- feature/ready-to-release
# @see: https://dev.to/erikhofer/build-and-publish-a-multi-platform-electron-app-on-github-3lnd
# on:
# push:
# tags:
# - 'v*'

jobs:
publish_on_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: install dependencies
run: yarn install
- name: build
run: yarn run make
# - name: publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: yarn run publish

publish_on_mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: install dependencies
run: yarn install
# see: https://dev.to/rwwagner90/signing-electron-apps-with-github-actions-4cof
- name: Add MacOS certs
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Add api key file
run: |
echo "${{ secrets.APPLE_API_KEY_CONTENT }}" > authKey.p8
APPLE_API_KEY=$(realpath authKey.p8)
echo "APPLE_API_KEY=$APPLE_API_KEY" >> $GITHUB_ENV
- name: build
env:
APPLE_API_KEY: ${{ env.APPLE_API_KEY }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: DEBUG=* yarn run make
# - name: publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: yarn run publish

publish_on_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: install dependencies
run: yarn install
- name: build
run: yarn run make
# - name: publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: yarn run publish
24 changes: 24 additions & 0 deletions add-osx-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env sh

# see: https://dev.to/rwwagner90/signing-electron-apps-with-github-actions-4cof
KEY_CHAIN=build.keychain
CERTIFICATE_P12=certificate.p12

# Recreate the certificate from the secure environment variable
echo $CERTIFICATE_OSX_APPLICATION | base64 --decode > $CERTIFICATE_P12

#create a keychain
security create-keychain -p actions $KEY_CHAIN

# Make the keychain the default so identities are found
security default-keychain -s $KEY_CHAIN

# Unlock the keychain
security unlock-keychain -p actions $KEY_CHAIN

security import $CERTIFICATE_P12 -k $KEY_CHAIN -P $CERTIFICATE_PASSWORD -T /usr/bin/codesign;

security set-key-partition-list -S apple-tool:,apple: -s -k actions $KEY_CHAIN

# remove certs
rm -fr *.p12
21 changes: 21 additions & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import { MakerZIP } from '@electron-forge/maker-zip';
import { FusesPlugin } from '@electron-forge/plugin-fuses';
import { VitePlugin } from '@electron-forge/plugin-vite';
import type { ForgeConfig } from '@electron-forge/shared-types';
import dotenv from 'dotenv';

dotenv.config();

const config: ForgeConfig = {
packagerConfig: {
asar: true,
icon: 'src/shared/assets/icons/icon',
osxSign: {},
osxNotarize: {
// @see: https://www.electronforge.io/guides/code-signing/code-signing-macos#option-2-using-an-app-store-connect-api-key
appleApiKey: process.env.APPLE_API_KEY as string,
appleApiKeyId: process.env.APPLE_API_KEY_ID as string,
appleApiIssuer: process.env.APPLE_API_ISSUER as string,
},
},
rebuildConfig: {},
makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})],
Expand Down Expand Up @@ -49,6 +58,18 @@ const config: ForgeConfig = {
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'Nexters',
name: 'PomoNyang-fe',
},
draft: true,
},
},
],
};

export default config;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
"@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
"@electron-forge/plugin-fuses": "^7.4.0",
"@electron-forge/plugin-vite": "^7.4.0",
"@electron-forge/publisher-github": "^7.4.0",
"@electron/fuses": "^1.8.0",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.1",
"autoprefixer": "^10.4.19",
"dotenv": "^16.4.5",
"electron": "31.2.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^9.1.0",
Expand Down
Loading

0 comments on commit 169e745

Please sign in to comment.