From cb281cad7423245a5bb220a8564007672de0df33 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Sat, 7 Oct 2023 23:41:49 +0200 Subject: [PATCH] add release message and help --- .../Tutorial_For_HiddifyNext_Linux.desktop | 7 +++ .../آموزش هیدیفای‌نکست فارسی لینوکس.desktop | 7 +++ .../mac-windows/Tutorial_For_HiddifyNext.url | 2 + .../mac-windows/آموزش هیدیفای‌نکست فارسی.url | 2 + .github/release_message.md | 8 ++-- .github/workflows/build.yml | 43 +++++++++++++------ 6 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 .github/help/linux/Tutorial_For_HiddifyNext_Linux.desktop create mode 100644 .github/help/linux/آموزش هیدیفای‌نکست فارسی لینوکس.desktop create mode 100644 .github/help/mac-windows/Tutorial_For_HiddifyNext.url create mode 100644 .github/help/mac-windows/آموزش هیدیفای‌نکست فارسی.url diff --git a/.github/help/linux/Tutorial_For_HiddifyNext_Linux.desktop b/.github/help/linux/Tutorial_For_HiddifyNext_Linux.desktop new file mode 100644 index 00000000..6259c0f2 --- /dev/null +++ b/.github/help/linux/Tutorial_For_HiddifyNext_Linux.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Icon=text-html +Name[en_US]=Tutorial_For_HiddifyNext_Linux +Name=Tutorial_For_HiddifyNext_Linux +Type=Link +URL=https://github.com/hiddify/Hiddify-Server/wiki/Tutorial-for-HiddifyNext-app diff --git a/.github/help/linux/آموزش هیدیفای‌نکست فارسی لینوکس.desktop b/.github/help/linux/آموزش هیدیفای‌نکست فارسی لینوکس.desktop new file mode 100644 index 00000000..b4a644b2 --- /dev/null +++ b/.github/help/linux/آموزش هیدیفای‌نکست فارسی لینوکس.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Encoding=UTF-8 +Icon=text-html +Name[en_US]=آموزش هیدیفای‌نکست فارسی لینوکس +Name=آموزش هیدیفای‌نکست فارسی لینوکس +Type=Link +URL=https://github.com/hiddify/Hiddify-Server/wiki/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%DA%A9%D8%A7%D8%B1-%D8%A8%D8%A7-%D9%86%D8%B1%D9%85%E2%80%8C%D8%A7%D9%81%D8%B2%D8%A7%D8%B1-%D9%87%DB%8C%D8%AF%DB%8C%D9%81%D8%A7%DB%8C%E2%80%8C%D9%86%DA%A9%D8%B3%D8%AA diff --git a/.github/help/mac-windows/Tutorial_For_HiddifyNext.url b/.github/help/mac-windows/Tutorial_For_HiddifyNext.url new file mode 100644 index 00000000..0157f7b4 --- /dev/null +++ b/.github/help/mac-windows/Tutorial_For_HiddifyNext.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://github.com/hiddify/Hiddify-Server/wiki/Tutorial-for-HiddifyNext-app \ No newline at end of file diff --git a/.github/help/mac-windows/آموزش هیدیفای‌نکست فارسی.url b/.github/help/mac-windows/آموزش هیدیفای‌نکست فارسی.url new file mode 100644 index 00000000..f50752a1 --- /dev/null +++ b/.github/help/mac-windows/آموزش هیدیفای‌نکست فارسی.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://github.com/hiddify/Hiddify-Server/wiki/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%DA%A9%D8%A7%D8%B1-%D8%A8%D8%A7-%D9%86%D8%B1%D9%85%E2%80%8C%D8%A7%D9%81%D8%B2%D8%A7%D8%B1-%D9%87%DB%8C%D8%AF%DB%8C%D9%81%D8%A7%DB%8C%E2%80%8C%D9%86%DA%A9%D8%B3%D8%AA diff --git a/.github/release_message.md b/.github/release_message.md index 16ff5e73..9cedd8e7 100644 --- a/.github/release_message.md +++ b/.github/release_message.md @@ -5,13 +5,13 @@ or download from below based on your OS: -- **Android:** [Universal](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-x86_64.apk) +- **Android:** [Universal](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-android-x86_64.apk) -- **Windows:** [x64 Setup](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-portable.zip) +- **Windows:** [x64 Setup](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-windows-x64-portable.zip) -- **Linux:** [x64 AppImage](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-linux-x64.AppImage.zip) +- **Linux:** [x64 AppImage](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-linux-x64.AppImage.zip) -- **macOS (v10.14+):** [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-macos-universal.dmg) +- **macOS (v10.14+):** [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/download/${tag}/hiddify-macos-universal.dmg) - **Build from source:** [Build & contribute guide](contribute.md) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5160885c..bfc3c612 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,12 +4,12 @@ on: branches: - main tags: - - 'v*' + - "v*" paths-ignore: - - '**.md' - - 'docs/**' - - '.github/**' - - '!.github/workflows/build.yml' + - "**.md" + - "docs/**" + - ".github/**" + - "!.github/workflows/build.yml" pull_request: branches: - main @@ -61,15 +61,15 @@ jobs: - name: Setup Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.13.x' - channel: 'stable' + flutter-version: "3.13.x" + channel: "stable" cache: true - name: Setup Java if: startsWith(matrix.platform,'android') uses: actions/setup-java@v3 with: - distribution: 'zulu' + distribution: "zulu" java-version: 11 - name: Setup Flutter Distributor @@ -149,15 +149,21 @@ jobs: if: matrix.platform == 'windows' run: | New-Item -ItemType Directory -Force -Name "out" + New-Item -ItemType Directory -Force -Name "tmp_out" $EXT_ARRAY = "${{ matrix.targets }}" -split "," foreach ($EXT in $EXT_ARRAY) { # Find all files with this extension in the current directory, and copy them to "out" directory Get-ChildItem -Recurse -File -Filter "*setup.$EXT" | Copy-Item -Destination "out" -ErrorAction SilentlyContinue - move out\*setup.$EXT out\hiddify-${{ matrix.platform }}-x64-setup.$EXT + move out\*setup.$EXT hiddify-${{ matrix.platform }}-x64-setup\setup.$EXT Get-ChildItem -Recurse -File -Filter "*.$EXT" } + + xcopy /s /v '.\.github\help\mac-windows\' .\hiddify-${{ matrix.platform }}-x64-setup\ + Compress-Archive hiddify-${{ matrix.platform }}-x64-setup out\hiddify-${{ matrix.platform }}-x64-setup.zip + mkdir HiddifyNext-portable xcopy /s /v D:\a\hiddify-next\hiddify-next\build\windows\runner\Release\ .\HiddifyNext-portable\ + xcopy /s /v '.\.github\help\mac-windows\' .\HiddifyNext-portable\ Compress-Archive HiddifyNext-portable out\hiddify-${{ matrix.platform }}-x64-portable.zip - name: Copy to out Android apk @@ -189,8 +195,9 @@ jobs: find "." -type f -name "*.$EXT" -exec cp {} "out" \; done mv out/*.AppImage out/hiddify-linux-x64.AppImage || echo "no app image" - (cd out&& chmod +x hiddify-linux-x64.AppImage && 7z a hiddify-linux-x64.AppImage.zip hiddify-linux-x64.AppImage)||echo "no app image" - mv out/*.dmg out/hiddify-macos-universal.dmg || echo "no macos dmg" + (chmod +x out/hiddify-linux-x64.AppImage && cp ./.github/help/linux/* out/)||echo "no app image" + (mv out/*.dmg out/hiddify-macos-universal.dmg && cp ./.github/help/mac-windows/* out/ )|| echo "no macos dmg" + (cd out && 7z a hiddify-${matrix.platform}-x64.zip ./ && rm !(*.zip)) - name: Upload Artifact uses: actions/upload-artifact@v3 @@ -219,7 +226,7 @@ jobs: uses: 8Mi-Tech/delete-release-assets-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} - tag: 'draft' + tag: "draft" deleteOnlyFromDrafts: false - name: Create or Update Draft Release @@ -229,8 +236,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: files: ./out/* - name: 'draft' - tag_name: 'draft' + name: "draft" + tag_name: "draft" prerelease: true upload-release: @@ -244,6 +251,13 @@ jobs: name: artifact path: ./out/ + - name: prepare_release_message + run: | + pip install gitchangelog + previous_release=$(curl --silent "https://api.github.com/repos/hiddify/hiddify-next/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') + current="${{ github.ref_name }}" + gitchangelog "${previous_release}..v$current" > release.md + sed 's|${tag}|${{ github.ref_name }}|g' ./.github/release_message.md >> release.md - name: Display Files Structure run: ls -R working-directory: ./out @@ -256,6 +270,7 @@ jobs: with: prerelease: ${{ env.CHANNEL == 'dev' }} tag_name: ${{ github.ref_name }} + body_path: "./.github/release_message.md" files: ./out/* - name: Create service_account.json