Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

ci: add upload portable to release github

Minh1411204b13100f67a4
diff --git a/.github/workflows/template-tauri-build-windows-x64.yml b/.github/workflows/template-tauri-build-windows-x64.yml
index cd32242e1..6fb908b3e 100644
--- a/.github/workflows/template-tauri-build-windows-x64.yml
+++ b/.github/workflows/template-tauri-build-windows-x64.yml
@@ -56,6 +56,8 @@ on:
value: ${{ jobs.build-windows-x64.outputs.FILE_NAME }}
MSI_FILE_NAME:
value: ${{ jobs.build-windows-x64.outputs.MSI_FILE_NAME }}
+ PORTABLE_FILE_NAME:
+ value: ${{ jobs.build-windows-x64.outputs.PORTABLE_FILE_NAME }}
jobs:
build-windows-x64:
@@ -64,6 +66,7 @@ jobs:
WIN_SIG: ${{ steps.metadata.outputs.WIN_SIG }}
FILE_NAME: ${{ steps.metadata.outputs.FILE_NAME }}
MSI_FILE_NAME: ${{ steps.metadata.outputs.MSI_FILE_NAME }}
+ PORTABLE_FILE_NAME: ${{ steps.metadata.outputs.PORTABLE_FILE_NAME }}
permissions:
contents: write
steps:
@@ -258,16 +261,27 @@ jobs:
WIN_SIG=$(cat Jan-${{ inputs.channel }}_${{ inputs.new_version }}_x64-setup.exe.sig)
MSI_FILE="Jan-${{ inputs.channel }}_${{ inputs.new_version }}_x64_en-US.msi"
+ PORTABLE_FILE_NAME="Jan-${{ inputs.channel }}_${{ inputs.new_version }}_x64-portable.exe"
else
FILE_NAME=Jan_${{ inputs.new_version }}_x64-setup.exe
WIN_SIG=$(cat Jan_${{ inputs.new_version }}_x64-setup.exe.sig)
MSI_FILE="Jan_${{ inputs.new_version }}_x64_en-US.msi"
+ PORTABLE_FILE_NAME="Jan_${{ inputs.new_version }}_x64-portable.exe"
fi
+ # go to ./src-tauri/target/release
+ cd ../../..
+
+ # find the actual portable exe produced by the build
+ PORTABLE_SRC=$(ls -1 Jan*.exe | head -n 1)
+ # copy to deterministic versioned filename
+ cp "$PORTABLE_SRC" "$PORTABLE_FILE_NAME"
+ echo "Portable exe: $PORTABLE_SRC -> $PORTABLE_FILE_NAME"
echo "::set-output name=WIN_SIG::$WIN_SIG"
echo "::set-output name=FILE_NAME::$FILE_NAME"
echo "::set-output name=MSI_FILE_NAME::$MSI_FILE"
+ echo "::set-output name=PORTABLE_FILE_NAME::$PORTABLE_FILE_NAME"
id: metadata
## Upload to s3 for nightly and beta
@@ -296,3 +310,14 @@ jobs:
asset_path: ./src-tauri/target/release/bundle/nsis/${{ steps.metadata.outputs.FILE_NAME }}
asset_name: ${{ steps.metadata.outputs.FILE_NAME }}
asset_content_type: application/octet-stream
+
+ - name: Upload portable exe to release (github)
+ if: inputs.public_provider == 'github'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ uses: actions/[email protected]
+ with:
+ upload_url: ${{ inputs.upload_url }}
+ asset_path: ./src-tauri/target/release/${{ steps.metadata.outputs.PORTABLE_FILE_NAME }}
+ asset_name: ${{ steps.metadata.outputs.PORTABLE_FILE_NAME }}
+ asset_content_type: application/octet-stream
\ No newline at end of file