-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Release v0.0.1-alpha.16 (#563)
- Loading branch information
Showing
15 changed files
with
314 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: Nightly Release | ||
|
||
on: | ||
schedule: | ||
- cron: "0 22 * * *" # Runs at 10 PM UTC every day | ||
|
||
env: | ||
VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} | ||
VITE_API_URL: ${{ vars.VITE_API_URL }} | ||
VITE_IMGPROXY_URL: ${{ vars.VITE_IMGPROXY_URL }} | ||
VITE_SENTRY_DSN: ${{ vars.VITE_SENTRY_DSN }} | ||
VITE_POSTHOG_KEY: ${{ vars.VITE_POSTHOG_KEY }} | ||
NODE_OPTIONS: --max-old-space-size=8192 | ||
|
||
jobs: | ||
nightly-release: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
attestations: write | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: true | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ matrix.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ matrix.os }}- | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: "pnpm" | ||
|
||
- name: Install appdmg | ||
if: runner.os == 'macOS' | ||
run: pnpm add -g appdmg | ||
|
||
# ... (macOS certificate and provisioning profile setup steps) ... | ||
|
||
- name: Install dependencies | ||
run: pnpm i | ||
|
||
- name: Set nightly version | ||
run: | | ||
# Get the current version from package.json | ||
CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
# Remove any existing prerelease identifier (e.g., -alpha.1) | ||
BASE_VERSION=$(echo $CURRENT_VERSION | sed -E 's/(-[a-zA-Z]+\.[0-9]+)$//') | ||
# Generate the nightly version | ||
NIGHTLY_DATE=$(date +'%Y%m%d') | ||
NIGHTLY_VERSION="${BASE_VERSION}-nightly.${NIGHTLY_DATE}" | ||
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV | ||
# Update version in package.json | ||
sed -i.bak -e "s/\"version\": \".*\"/\"version\": \"$NIGHTLY_VERSION\"/" package.json | ||
echo "Updated version to $NIGHTLY_VERSION" | ||
- name: Build | ||
if: matrix.os != 'macos-latest' | ||
run: pnpm build | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
|
||
- name: Build (macOS) | ||
if: matrix.os == 'macos-latest' | ||
env: | ||
APPLE_ID: ${{ secrets.APPLE_ID }} | ||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db | ||
run: pnpm build:macos | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.os }}-nightly | ||
path: | | ||
out/make/**/*.zip | ||
out/make/**/*.exe | ||
out/make/**/*.AppImage | ||
out/make/**/*.yml | ||
out/make/**/*.dmg | ||
retention-days: 7 | ||
|
||
- name: Generate artifact attestation | ||
continue-on-error: true | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: | | ||
out/make/**/*.dmg | ||
out/make/**/*.zip | ||
out/make/**/*.exe | ||
out/make/**/*.AppImage | ||
out/make/**/*.yml | ||
- name: Create Nightly Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: Nightly ${{ env.NIGHTLY_VERSION }} | ||
draft: false | ||
prerelease: true | ||
tag_name: nightly-${{ env.NIGHTLY_VERSION }} | ||
files: | | ||
out/make/**/*.dmg | ||
out/make/**/*.zip | ||
out/make/**/*.exe | ||
out/make/**/*.AppImage | ||
out/make/**/*.yml | ||
body: | | ||
This is an automated nightly release for testing purposes. | ||
Version: 0.0.0-nightly.${{ env.NIGHTLY_VERSION }} | ||
**Warning:** This build may be unstable and is not recommended for production use. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { callGlobalContextMethod } from "@follow/shared/bridge" | ||
import { dialog } from "electron" | ||
|
||
import { getMainWindow } from "~/window" | ||
|
||
import { t } from "./i18n" | ||
|
||
export const clearAllData = async () => { | ||
const win = getMainWindow() | ||
if (!win) return | ||
const ses = win.webContents.session | ||
|
||
// Dialog to confirm | ||
const result = await dialog.showMessageBox({ | ||
type: "warning", | ||
|
||
message: t("dialog.clearAllData"), | ||
buttons: [t("dialog.yes"), t("dialog.no")], | ||
}) | ||
|
||
if (result.response === 1) { | ||
return | ||
} | ||
try { | ||
await ses.clearCache() | ||
|
||
await ses.clearStorageData({ | ||
storages: [ | ||
"websql", | ||
"filesystem", | ||
"indexdb", | ||
"localstorage", | ||
"shadercache", | ||
"websql", | ||
"serviceworkers", | ||
"cookies", | ||
], | ||
}) | ||
callGlobalContextMethod(win, "toast.success", ["App data reset successfully"]) | ||
|
||
// reload the app | ||
win.reload() | ||
} catch (error: any) { | ||
callGlobalContextMethod(win, "toast.error", [`Error resetting app data: ${error.message}`]) | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.