|
| 1 | +name: Build and Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-linux: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - name: Set up GraalVM |
| 15 | + uses: graalvm/setup-graalvm@v1 |
| 16 | + with: |
| 17 | + java-version: "21" |
| 18 | + components: "native-image" |
| 19 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 20 | + |
| 21 | + - name: Build native executable |
| 22 | + run: ./gradlew nativeCompile |
| 23 | + |
| 24 | + - name: Create release directory |
| 25 | + run: | |
| 26 | + mkdir -p klox-linux |
| 27 | + cp build/native/nativeCompile/klox klox-linux/ |
| 28 | + cp README.md QUICKSTART.md FEATURES.md CUSTOM_FEATURES.md klox-linux/ |
| 29 | + chmod +x klox-linux/klox |
| 30 | +
|
| 31 | + - name: Create archive |
| 32 | + run: tar -czf klox-linux-x64.tar.gz klox-linux/ |
| 33 | + |
| 34 | + - name: Upload to release |
| 35 | + uses: softprops/action-gh-release@v1 |
| 36 | + with: |
| 37 | + files: klox-linux-x64.tar.gz |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + build-macos: |
| 42 | + runs-on: macos-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Set up GraalVM |
| 47 | + uses: graalvm/setup-graalvm@v1 |
| 48 | + with: |
| 49 | + java-version: "21" |
| 50 | + components: "native-image" |
| 51 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + |
| 53 | + - name: Build native executable |
| 54 | + run: ./gradlew nativeCompile |
| 55 | + |
| 56 | + - name: Create release directory |
| 57 | + run: | |
| 58 | + mkdir -p klox-macos |
| 59 | + cp build/native/nativeCompile/klox klox-macos/ |
| 60 | + cp README.md QUICKSTART.md FEATURES.md CUSTOM_FEATURES.md klox-macos/ |
| 61 | + chmod +x klox-macos/klox |
| 62 | +
|
| 63 | + - name: Create archive |
| 64 | + run: tar -czf klox-macos-arm64.tar.gz klox-macos/ |
| 65 | + |
| 66 | + - name: Upload to release |
| 67 | + uses: softprops/action-gh-release@v1 |
| 68 | + with: |
| 69 | + files: klox-macos-arm64.tar.gz |
| 70 | + env: |
| 71 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + |
| 73 | + build-windows: |
| 74 | + runs-on: windows-latest |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + |
| 78 | + - name: Set up GraalVM |
| 79 | + uses: graalvm/setup-graalvm@v1 |
| 80 | + with: |
| 81 | + java-version: "21" |
| 82 | + components: "native-image" |
| 83 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + |
| 85 | + - name: Build native executable |
| 86 | + run: .\gradlew.bat nativeCompile |
| 87 | + |
| 88 | + - name: Create release directory |
| 89 | + run: | |
| 90 | + mkdir klox-windows |
| 91 | + copy build\native\nativeCompile\klox.exe klox-windows\ |
| 92 | + copy README.md klox-windows\ |
| 93 | + copy QUICKSTART.md klox-windows\ |
| 94 | + copy FEATURES.md klox-windows\ |
| 95 | + copy CUSTOM_FEATURES.md klox-windows\ |
| 96 | +
|
| 97 | + - name: Create archive |
| 98 | + run: | |
| 99 | + cd klox-windows |
| 100 | + tar -czf ..\klox-windows-x64.tar.gz * |
| 101 | + cd .. |
| 102 | +
|
| 103 | + - name: Upload to release |
| 104 | + uses: softprops/action-gh-release@v1 |
| 105 | + with: |
| 106 | + files: klox-windows-x64.tar.gz |
| 107 | + env: |
| 108 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments