Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing configuration for Graal native images #4271

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,43 @@ jobs:

- run: ./mill -i mill.scalalib.PublishModule/

publish-sonatype-native:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill'
needs: build-artifacts
runs-on: ${{ matrix.os }}

# only run one publish job for the same sha at the same time
# e.g. when a main-branch push is also tagged
concurrency: publish-sonatype-native-${{ github.sha }}
strategy:
matrix:
include:
- os: macos-latest
- os: ubuntu-latest
env:
MILL_STABLE_VERSION: 1
MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MILL_PGP_SECRET_BASE64: ${{ secrets.SONATYPE_PGP_SECRET }}
MILL_PGP_PASSPHRASE: ${{ secrets.SONATYPE_PGP_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"

steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }

- uses: coursier/cache-action@v6

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin

- run: ./mill -i mill.scalalib.PublishModule/ dist.native.publishArtifacts

release-github:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill'
Expand Down
9 changes: 9 additions & 0 deletions dist/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ object `package` extends RootModule with build.MillPublishJavaModule {
def moduleDeps = build.dist.moduleDeps
def nativeImageExecutableName = if (Properties.isWin) "mill.exe" else "mill"

def artifactOsSuffix = T{
val osName = System.getProperty("os.name").toLowerCase
if (osName.contains("mac")) "mac"
else if (osName.contains("windows")) "windows"
else "linux"
}
def artifactCpuSuffix = T{ System.getProperty("os.arch") }
def artifactName = s"${super.artifactName()}-${artifactOsSuffix()}-${artifactCpuSuffix()}"

def mainClass = Some("mill.runner.client.MillClientMain")

def nativeImageClasspath = build.runner.client.runClasspath()
Expand Down
Loading