-
Notifications
You must be signed in to change notification settings - Fork 13
103 lines (84 loc) · 3.43 KB
/
debug_workflow.yml
File metadata and controls
103 lines (84 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Debug Workflow
on: workflow_dispatch
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build everything
run: |
pnpm build
- name: Pack packages
run: |
pnpm pack -r --pack-destination release-artifacts
- name: Check if versions exist on npm
id: check_versions
run: |
# Detect npm tag from version (alpha, beta, rc, etc.)
get_npm_tag() {
local version=$1
if [[ "$version" == *"-alpha"* ]]; then
echo "alpha"
elif [[ "$version" == *"-beta"* ]]; then
echo "beta"
elif [[ "$version" == *"-rc"* ]]; then
echo "rc"
else
echo "latest"
fi
}
check_npm_version() {
local pkg_name=$1
local pkg_path=$2
local output_key=$3
LOCAL_VERSION=$(node -p "require('./${pkg_path}/package.json').version")
NPM_TAG=$(get_npm_tag "$LOCAL_VERSION")
echo "${pkg_name} local version: $LOCAL_VERSION (tag: $NPM_TAG)"
echo "${output_key}_tag=${NPM_TAG}" >> $GITHUB_OUTPUT
if npm view "${pkg_name}@${LOCAL_VERSION}" version 2>/dev/null; then
echo "${pkg_name}@${LOCAL_VERSION} already exists on npm"
echo "${output_key}_exists=true" >> $GITHUB_OUTPUT
else
echo "${pkg_name}@${LOCAL_VERSION} does not exist on npm"
echo "${output_key}_exists=false" >> $GITHUB_OUTPUT
fi
}
check_npm_version "@ton/walletkit" "packages/walletkit" "walletkit"
check_npm_version "@ton/appkit" "packages/appkit" "appkit"
check_npm_version "@ton/appkit-react" "packages/appkit-react" "appkit_react"
# Output walletkit version for release naming
WALLETKIT_VERSION=$(node -p "require('./packages/walletkit/package.json').version")
echo "walletkit_version=${WALLETKIT_VERSION}" >> $GITHUB_OUTPUT
- name: Prepare checksums for release
run: |
# Copy and rename Android bridge checksums
if [ -f "packages/walletkit-android-bridge/dist/checksums.json" ]; then
cp packages/walletkit-android-bridge/dist/checksums.json release-artifacts/walletkit-android-bridge.checksums.json
else
echo "Warning: Android bridge checksums not found at packages/walletkit-android-bridge/dist/checksums.json"
fi
# Copy and rename iOS bridge checksums
if [ -f "packages/walletkit-ios-bridge/dist/checksums.json" ]; then
cp packages/walletkit-ios-bridge/dist/checksums.json release-artifacts/walletkit-ios-bridge.checksums.json
else
echo "Warning: iOS bridge checksums not found"
fi
- name: Debug git status
run: |
echo "=== Git Status Debug ==="
git status
echo "=== End Git Status Debug ==="