Skip to content

Commit 90881af

Browse files
committed
chore: prepare v2.1.11
1 parent 843bf5e commit 90881af

File tree

4 files changed

+119
-21
lines changed

4 files changed

+119
-21
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ jobs:
216216
echo "CC=${{ env.ARCH_NAME }}-clang" >> $GITHUB_ENV
217217
echo "CXX=${{ env.ARCH_NAME }}-clang++" >> $GITHUB_ENV
218218
echo "LD_FLAGS=-w" >> $GITHUB_ENV
219-
219+
220220
- name: Setup for Windows
221221
if: env.GOOS == 'windows'
222222
run: |
@@ -225,6 +225,7 @@ jobs:
225225
226226
# Install cross compilers based on architecture
227227
sudo apt-get update
228+
sudo apt-get install -y zip
228229
if [[ "$GOARCH" == "amd64" ]]; then
229230
echo "Installing x86_64 Windows cross compiler"
230231
sudo apt-get install -y gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
@@ -267,19 +268,29 @@ jobs:
267268
find dist -printf '%P\n' | tar -C dist --no-recursion -zcvf ${{ env.DIST }}.tar.gz -T -
268269
openssl dgst -sha512 ${{ env.DIST }}.tar.gz | sed 's/([^)]*)//g' | awk '{print $NF}' >> ${{ env.DIST }}.tar.gz.digest
269270
271+
# Create zip for Windows builds (for winget compatibility)
272+
if [[ "$GOOS" == "windows" ]]; then
273+
cd dist
274+
zip -r ../${{ env.DIST }}.zip .
275+
cd ..
276+
openssl dgst -sha512 ${{ env.DIST }}.zip | sed 's/([^)]*)//g' | awk '{print $NF}' >> ${{ env.DIST }}.zip.digest
277+
fi
278+
270279
- name: Publish
271280
uses: softprops/action-gh-release@v2
272281
if: github.event_name == 'release'
273282
with:
274283
files: |
275284
${{ env.DIST }}.tar.gz
276285
${{ env.DIST }}.tar.gz.digest
277-
286+
${{ env.GOOS == 'windows' && format('{0}.zip', env.DIST) || '' }}
287+
${{ env.GOOS == 'windows' && format('{0}.zip.digest', env.DIST) || '' }}
288+
278289
- name: Set up nodejs
279290
uses: actions/setup-node@v4
280291
with:
281292
node-version: current
282-
293+
283294
- name: Install dependencies
284295
run: |
285296
corepack enable
@@ -298,6 +309,10 @@ jobs:
298309
command: |
299310
r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz --file ./${{ env.DIST }}.tar.gz --remote
300311
r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest --file ./${{ env.DIST }}.tar.gz.digest --remote
312+
if [[ "$GOOS" == "windows" ]]; then
313+
r2 object put nginx-ui-dev-build/${{ env.DIST }}.zip --file ./${{ env.DIST }}.zip --remote
314+
r2 object put nginx-ui-dev-build/${{ env.DIST }}.zip.digest --file ./${{ env.DIST }}.zip.digest --remote
315+
fi
301316
302317
docker-build:
303318
if: github.event_name != 'pull_request'

.github/workflows/homebrew.yml

Lines changed: 99 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,80 @@
11
name: Update Homebrew Formula
22

33
on:
4-
workflow_run:
5-
workflows: ["Build"]
6-
types:
7-
- completed
84
release:
95
types:
106
- published
117

128
jobs:
139
update-homebrew:
1410
runs-on: ubuntu-latest
15-
if: github.event_name == 'release' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'release')
11+
if: github.event_name == 'release'
1612
steps:
1713
- name: Checkout
1814
uses: actions/checkout@v4
1915

2016
- name: Get release info
2117
id: release
2218
run: |
23-
if [[ "${{ github.event_name }}" == "release" ]]; then
24-
echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
25-
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
26-
else
27-
# Get latest release info
28-
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest")
29-
TAG_NAME=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
30-
VERSION=${TAG_NAME#v}
31-
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
32-
echo "version=$VERSION" >> $GITHUB_OUTPUT
33-
fi
19+
echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
20+
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
21+
22+
- name: Wait for release assets to be available
23+
run: |
24+
TAG_NAME="${{ steps.release.outputs.tag_name }}"
25+
26+
# Function to check if a file exists
27+
check_file() {
28+
local url="$1"
29+
local filename="$2"
30+
echo "Checking if $filename is available..."
31+
if curl --output /dev/null --silent --head --fail "$url"; then
32+
echo "✓ $filename is available"
33+
return 0
34+
else
35+
echo "✗ $filename is not yet available"
36+
return 1
37+
fi
38+
}
39+
40+
# List of files to check
41+
declare -a files=(
42+
"https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/nginx-ui-macos-64.tar.gz"
43+
"https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/nginx-ui-macos-arm64-v8a.tar.gz"
44+
"https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/nginx-ui-linux-64.tar.gz"
45+
"https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/nginx-ui-linux-arm64-v8a.tar.gz"
46+
)
47+
48+
# Wait for all files to be available (max 10 minutes)
49+
max_attempts=60
50+
attempt=1
51+
52+
while [ $attempt -le $max_attempts ]; do
53+
echo "Attempt $attempt/$max_attempts - Checking release assets..."
54+
all_available=true
55+
56+
for url in "${files[@]}"; do
57+
filename=$(basename "$url")
58+
if ! check_file "$url" "$filename"; then
59+
all_available=false
60+
break
61+
fi
62+
done
63+
64+
if [ "$all_available" = true ]; then
65+
echo "All release assets are available!"
66+
break
67+
fi
68+
69+
if [ $attempt -eq $max_attempts ]; then
70+
echo "Timeout: Not all release assets are available after $max_attempts attempts"
71+
exit 1
72+
fi
73+
74+
echo "Waiting 10 seconds before next check..."
75+
sleep 10
76+
((attempt++))
77+
done
3478
3579
- name: Download release assets and calculate SHA256 checksums
3680
id: checksums
@@ -98,6 +142,45 @@ jobs:
98142
99143
def install
100144
bin.install "nginx-ui"
145+
146+
# Create configuration directory
147+
(etc/"nginx-ui").mkpath
148+
149+
# Create default configuration file if it doesn't exist
150+
config_file = etc/"nginx-ui/app.ini"
151+
unless config_file.exist?
152+
config_file.write <<~EOS
153+
[app]
154+
PageSize = 10
155+
156+
[server]
157+
Host = 0.0.0.0
158+
Port = 9000
159+
RunMode = release
160+
161+
[cert]
162+
HTTPChallengePort = 9180
163+
164+
[terminal]
165+
StartCmd = login
166+
EOS
167+
end
168+
169+
# Create data directory
170+
(var/"nginx-ui").mkpath
171+
end
172+
173+
def post_install
174+
# Ensure correct permissions
175+
(var/"nginx-ui").chmod 0755
176+
end
177+
178+
service do
179+
run [opt_bin/"nginx-ui", "serve", "--config", etc/"nginx-ui/app.ini"]
180+
keep_alive true
181+
working_dir var/"nginx-ui"
182+
log_path var/"log/nginx-ui.log"
183+
error_log_path var/"log/nginx-ui.err.log"
101184
end
102185
103186
test do

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nginx-ui-app-next",
33
"type": "module",
4-
"version": "2.1.10",
4+
"version": "2.1.11",
55
"packageManager": "[email protected]+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184",
66
"scripts": {
77
"dev": "vite --host",

app/src/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"2.1.10","build_id":7,"total_build":449}
1+
{"version":"2.1.11","build_id":1,"total_build":450}

0 commit comments

Comments
 (0)