|
| 1 | +--- |
| 2 | +name: "publish a release" |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + force_version: |
| 8 | + description: "Force version number to publish (empty for automatic semver versioning)" |
| 9 | + required: false |
| 10 | + default: "" |
| 11 | + to_publish: #TODO |
| 12 | + description: "What to publish" |
| 13 | + required: true |
| 14 | + default: "all" |
| 15 | + type: choice |
| 16 | + options: |
| 17 | + - plugin-gradle |
| 18 | + - plugin-maven |
| 19 | + - all |
| 20 | + - lib |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: write |
| 24 | + |
| 25 | +concurrency: |
| 26 | + group: "${{ github.workflow }}-${{ github.ref }}" |
| 27 | + cancel-in-progress: true |
| 28 | +jobs: |
| 29 | + nativeCompile: |
| 30 | + name: "${{ matrix.platform.name }}: create production-binary" |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + platform: |
| 34 | + - name: "linux-x86_64" |
| 35 | + runner: "ubuntu-latest" |
| 36 | + - name: "linux-aarch64" |
| 37 | + runner: "ubuntu-24.04-arm" |
| 38 | + - name: "windows-x86_64" |
| 39 | + runner: "windows-latest" |
| 40 | + - name: "macos-aaarch64" |
| 41 | + runner: "macos-latest" |
| 42 | + - name: "macos-x86_64" |
| 43 | + runner: "macos-13" |
| 44 | + runs-on: "${{ matrix.platform.runner }}" |
| 45 | + env: |
| 46 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15" |
| 47 | + steps: |
| 48 | + - name: "Checkout" |
| 49 | + uses: "actions/checkout@v4" |
| 50 | + with: |
| 51 | + fetch-depth: 0 |
| 52 | + - name: "Install JDK 21" |
| 53 | + uses: "actions/setup-java@v4" |
| 54 | + with: |
| 55 | + distribution: "graalvm" |
| 56 | + java-version: 21 |
| 57 | + - name: "Install Node.js" |
| 58 | + uses: actions/setup-node@v4 |
| 59 | + with: |
| 60 | + node-version: "lts/jod" # 22 |
| 61 | + - name: "Setup Gradle" |
| 62 | + uses: "gradle/actions/setup-gradle@v4" |
| 63 | + - name: "Run nativeCompile" |
| 64 | + run: "./gradlew -Prelease=true nativeCompile" |
| 65 | + - name: "upload binary" # for collecting later |
| 66 | + uses: actions/upload-artifact@v4 |
| 67 | + with: |
| 68 | + name: "${{ env.RUN_UNIQUE_ID }}-native-binary-${{ matrix.platform.name }}" |
| 69 | + path: app/build/native/nativeCompile/spotless |
| 70 | + retention-days: 1 |
| 71 | + if-no-files-found: "error" |
| 72 | + createRelease: |
| 73 | + needs: nativeCompile |
| 74 | + name: "Create a new release" |
| 75 | + runs-on: ubuntu-latest |
| 76 | + env: |
| 77 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15" |
| 78 | + steps: |
| 79 | + - name: "Checkout" |
| 80 | + uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + fetch-depth: 0 |
| 83 | + - name: "Install JDK 21" |
| 84 | + uses: "actions/setup-java@v4" |
| 85 | + with: |
| 86 | + distribution: "graalvm" |
| 87 | + java-version: 21 |
| 88 | + - name: "Setup Gradle" |
| 89 | + uses: "gradle/actions/setup-gradle@v4" |
| 90 | + - name: "Retrieve production-binaries" |
| 91 | + uses: "actions/download-artifact@v4" |
| 92 | + with: |
| 93 | + # no name - download all artifacts |
| 94 | + path: "app/build/collected-binaries" |
| 95 | + - name: Display structure of downloaded files |
| 96 | + run: "ls -R app/build/collected-binaries" |
0 commit comments