refactor: rm worker thread #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Deep Focus CI/CD and Release Workflow" | |
on: | |
pull_request: | |
paths: | |
- "**/*.ts" | |
- "**/*.tsx" | |
- "**/*.js" | |
- "package.json" | |
- "package-lock.json" | |
push: | |
branches: | |
- main | |
paths: | |
- "**/*.ts" | |
- "**/*.js" | |
- "package.json" | |
- "package-lock.json" | |
- ".github/workflows/release.yml" | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
jobs: | |
build-and-release: | |
runs-on: macos-latest | |
env: | |
CI_JOB_NUMBER: 1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Install dependencies | |
run: npm install | |
- name: Install the Apple certificate | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
# Set up paths for certificate and keychain | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# Import certificate from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
# Create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# Import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
- name: Store Notarization Credentials | |
run: | | |
xcrun notarytool store-credentials --apple-id "[email protected]" --team-id "3Y4F3KTSJA" --password ${{ secrets.APPLE_APP_PASSWORD }} --keychain-profile "notary" | |
- name: Run Linting | |
run: npm run lint | |
- name: Build Electron App | |
run: npm run make | |
- name: Package as Zip | |
run: | | |
mkdir -p release | |
zip -r release/DeepFocus-${{ github.run_number }}.zip out/make/* | |
- name: Analyze and Create Bundle Size Badge | |
uses: timeowilliams/[email protected] | |
with: | |
path: ".vite/build/*.js" | |
limit: "800" | |
label: "Bundle Size" | |
color: "green" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Verify Package Integrity | |
run: npm audit | |
- name: Run Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release | |
- name: Set Release Tag | |
id: set_tag | |
run: echo "RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | |
- name: Notarize App | |
run: | | |
xcrun notarytool submit release/DeepFocus-${{ github.run_number }}.zip --keychain-profile "notary" --wait | |
- name: Upload Release Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DeepFocus-${{ steps.set_tag.outputs.RELEASE_TAG }}-mac.zip | |
path: release/DeepFocus-${{ github.run_number }}.zip |