Merge pull request #115 from Gedochao/update/misc #260
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| jobs: | |
| generate-launchers: | |
| timeout-minutes: 30 | |
| needs: | |
| - scalafix | |
| - format | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, windows-latest, macos-15-intel, macos-15] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: coursier/cache-action@v7 | |
| - uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:17 | |
| - run: | | |
| ./mill -i "java-class-name.writeNativeImageScript" --scriptDest generate.sh --imageDest "" && \ | |
| ./generate.sh && \ | |
| ./mill -i "java-class-name.copyToArtifacts" --directory artifacts/ | |
| if: runner.os != 'Windows' | |
| - run: | | |
| @call ./mill.bat -i "java-class-name.writeNativeImageScript" --scriptDest generate.bat --imageDest "" | |
| @call generate.bat | |
| @call ./mill.bat -i "java-class-name.copyToArtifacts" --directory artifacts/ | |
| shell: cmd | |
| if: runner.os == 'Windows' | |
| - name: Test | |
| run: ./mill -i java-class-name-tests.test | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: launcher-${{ matrix.os }} | |
| path: artifacts/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| - run: ./mill -i ci.upload --directory artifacts/ | |
| if: github.event_name == 'push' | |
| env: | |
| UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| generate-static-launcher: | |
| timeout-minutes: 30 | |
| needs: | |
| - scalafix | |
| - format | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: coursier/cache-action@v7 | |
| - uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:17 | |
| - run: | | |
| ./mill -i "java-class-name.static.writeNativeImageScript" --scriptDest generate.sh --imageDest "" && \ | |
| ./generate.sh && \ | |
| ./mill -i "java-class-name.static.copyToArtifacts" --directory artifacts/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: launcher-linux-static | |
| path: artifacts/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| - name: Test | |
| run: ./mill -i java-class-name-static-tests.test | |
| - run: ./mill -i ci.upload --directory artifacts/ | |
| if: github.event_name == 'push' | |
| env: | |
| UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| generate-mostly-static-launcher: | |
| timeout-minutes: 30 | |
| needs: | |
| - scalafix | |
| - format | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: coursier/cache-action@v7 | |
| - uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:17 | |
| - run: | | |
| ./mill -i "java-class-name.mostly-static.writeNativeImageScript" --scriptDest generate.sh --imageDest "" && \ | |
| ./generate.sh && \ | |
| ./mill -i "java-class-name.mostly-static.copyToArtifacts" --directory artifacts/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: launcher-linux-mostly-static | |
| path: artifacts/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| - name: Test | |
| run: ./mill -i java-class-name-mostly-static-tests.test | |
| - run: ./mill -i ci.upload --directory artifacts/ | |
| if: github.event_name == 'push' | |
| env: | |
| UPLOAD_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| scalafix: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: coursier/cache-action@v7 | |
| - uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:17 | |
| - name: Run scalafix | |
| run: ./mill -i __.fix --check | |
| format: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: VirtusLab/scala-cli-setup@v1 | |
| - run: scala-cli fmt . --check | |
| publish: | |
| timeout-minutes: 30 | |
| needs: | |
| - generate-launchers | |
| - generate-static-launcher | |
| - generate-mostly-static-launcher | |
| - scalafix | |
| - format | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: coursier/cache-action@v7 | |
| - uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:17 | |
| - run: .github/scripts/gpg-setup.sh | |
| env: | |
| PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
| - name: Publish | |
| run: ./mill -i ci.publishSonatype --tasks __.publishArtifacts | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| PGP_PASSWORD: ${{ secrets.PGP_PASSPHRASE }} |