add release message and help
This commit is contained in:
43
.github/workflows/build.yml
vendored
43
.github/workflows/build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user