|
| 1 | +name: JTD-ESM-Codegen Nightly |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 3 * * *' # 3 AM UTC daily |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-uber-jar: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - uses: actions/setup-java@v4 |
| 17 | + with: |
| 18 | + distribution: 'temurin' |
| 19 | + java-version: '21' |
| 20 | + cache: 'maven' |
| 21 | + - name: Build uber JAR |
| 22 | + run: | |
| 23 | + ./mvnw -pl jtd-esm-codegen -am package |
| 24 | + cp jtd-esm-codegen/target/jtd-esm-codegen.jar jtd-esm-codegen.jar |
| 25 | + - uses: actions/upload-artifact@v4 |
| 26 | + with: |
| 27 | + name: uber-jar |
| 28 | + path: jtd-esm-codegen.jar |
| 29 | + |
| 30 | + native-linux: |
| 31 | + needs: build-uber-jar |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/download-artifact@v4 |
| 35 | + with: |
| 36 | + name: uber-jar |
| 37 | + path: . |
| 38 | + - uses: graalvm/setup-graalvm@v1 |
| 39 | + with: |
| 40 | + java-version: '21' |
| 41 | + distribution: 'graalvm' |
| 42 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + components: 'native-image' |
| 44 | + cache: 'maven' |
| 45 | + - name: Build native image |
| 46 | + run: | |
| 47 | + native-image --no-fallback -jar jtd-esm-codegen.jar jtd-esm-codegen-linux-amd64 |
| 48 | + chmod +x jtd-esm-codegen-linux-amd64 |
| 49 | + - uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: native-linux-amd64 |
| 52 | + path: jtd-esm-codegen-linux-amd64 |
| 53 | + |
| 54 | + native-windows: |
| 55 | + needs: build-uber-jar |
| 56 | + runs-on: windows-latest |
| 57 | + steps: |
| 58 | + - uses: actions/download-artifact@v4 |
| 59 | + with: |
| 60 | + name: uber-jar |
| 61 | + path: . |
| 62 | + - uses: graalvm/setup-graalvm@v1 |
| 63 | + with: |
| 64 | + java-version: '21' |
| 65 | + distribution: 'graalvm' |
| 66 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + components: 'native-image' |
| 68 | + cache: 'maven' |
| 69 | + - name: Build native image |
| 70 | + run: | |
| 71 | + native-image --no-fallback -jar jtd-esm-codegen.jar jtd-esm-codegen-windows-amd64 |
| 72 | + - uses: actions/upload-artifact@v4 |
| 73 | + with: |
| 74 | + name: native-windows-amd64 |
| 75 | + path: jtd-esm-codegen-windows-amd64.exe |
| 76 | + |
| 77 | + native-macos-intel: |
| 78 | + needs: build-uber-jar |
| 79 | + runs-on: macos-13 # Intel |
| 80 | + steps: |
| 81 | + - uses: actions/download-artifact@v4 |
| 82 | + with: |
| 83 | + name: uber-jar |
| 84 | + path: . |
| 85 | + - uses: graalvm/setup-graalvm@v1 |
| 86 | + with: |
| 87 | + java-version: '21' |
| 88 | + distribution: 'graalvm' |
| 89 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + components: 'native-image' |
| 91 | + cache: 'maven' |
| 92 | + - name: Build native image |
| 93 | + run: | |
| 94 | + native-image --no-fallback -jar jtd-esm-codegen.jar jtd-esm-codegen-macos-amd64 |
| 95 | + chmod +x jtd-esm-codegen-macos-amd64 |
| 96 | + - uses: actions/upload-artifact@v4 |
| 97 | + with: |
| 98 | + name: native-macos-amd64 |
| 99 | + path: jtd-esm-codegen-macos-amd64 |
| 100 | + |
| 101 | + native-macos-arm: |
| 102 | + needs: build-uber-jar |
| 103 | + runs-on: macos-14 # Apple Silicon |
| 104 | + steps: |
| 105 | + - uses: actions/download-artifact@v4 |
| 106 | + with: |
| 107 | + name: uber-jar |
| 108 | + path: . |
| 109 | + - uses: graalvm/setup-graalvm@v1 |
| 110 | + with: |
| 111 | + java-version: '21' |
| 112 | + distribution: 'graalvm' |
| 113 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + components: 'native-image' |
| 115 | + cache: 'maven' |
| 116 | + - name: Build native image |
| 117 | + run: | |
| 118 | + native-image --no-fallback -jar jtd-esm-codegen.jar jtd-esm-codegen-macos-arm64 |
| 119 | + chmod +x jtd-esm-codegen-macos-arm64 |
| 120 | + - uses: actions/upload-artifact@v4 |
| 121 | + with: |
| 122 | + name: native-macos-arm64 |
| 123 | + path: jtd-esm-codegen-macos-arm64 |
| 124 | + |
| 125 | + release: |
| 126 | + needs: [native-linux, native-windows, native-macos-intel, native-macos-arm] |
| 127 | + runs-on: ubuntu-latest |
| 128 | + steps: |
| 129 | + - uses: actions/download-artifact@v4 |
| 130 | + - name: Create nightly release |
| 131 | + uses: softprops/action-gh-release@v1 |
| 132 | + with: |
| 133 | + tag_name: nightly-${{ github.run_number }} |
| 134 | + name: Nightly Build ${{ github.run_number }} |
| 135 | + prerelease: true |
| 136 | + files: | |
| 137 | + native-linux-amd64/jtd-esm-codegen-linux-amd64 |
| 138 | + native-windows-amd64/jtd-esm-codegen-windows-amd64.exe |
| 139 | + native-macos-amd64/jtd-esm-codegen-macos-amd64 |
| 140 | + native-macos-arm64/jtd-esm-codegen-macos-arm64 |
| 141 | + uber-jar/jtd-esm-codegen.jar |
| 142 | +
|
0 commit comments