Update build.yml #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release SecVault | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
# Step 1: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Install Windows cross-compilation toolchain (Mingw-w64) | |
- name: Install Mingw-w64 | |
run: sudo apt-get update && sudo apt-get install -y mingw-w64 | |
# Step 3: Download JetBrains Runtime (JBR) | |
- name: Download JetBrains Runtime | |
run: | | |
JBR_URL="https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.1.tar.gz" | |
wget $JBR_URL -O jbr.tar.gz | |
mkdir jbr | |
tar -xzf jbr.tar.gz -C jbr --strip-components=1 | |
# Step 4: Set up Java environment | |
- name: Set up JetBrains Runtime | |
run: echo "JAVA_HOME=${{ github.workspace }}/jbr" >> $GITHUB_ENV | |
# Step 5: Grant Gradle permissions | |
- name: Grant execution permissions for gradlew | |
run: chmod +x ./gradlew | |
# Step 6: Build BOTH Linux (.deb) and Windows (.exe/msi) | |
- name: Build Linux and Windows packages | |
run: | | |
# Build Linux .deb package | |
./gradlew packageDeb --rerun-tasks | |
# Build Windows package (adjust task name based on your Gradle config) | |
./gradlew packageMsi --rerun-tasks # Or packageExe/packageWin | |
# Step 7: List output files (for debugging) | |
- name: List build artifacts | |
run: ls -R build/compose/binaries | |
# Step 8: Compress artifacts for release | |
- name: Compress artifacts | |
run: | | |
# Include both Linux (.deb) and Windows (.msi) artifacts | |
tar -czf release.tar.gz \ | |
-C build/compose/binaries/main/deb . \ | |
-C ../../msi . # Adjust path if using "exe" instead of "msi" | |
# Step 9: Create GitHub release | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "release.tar.gz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.run_id }} | |
name: Release Build ${{ github.run_id }} | |
body: | | |
Multiplatform release for SecVault. | |
- Linux: `.deb` package | |
- Windows: `.msi` installer |