Skip to content

Commit

Permalink
Merge branch 'main' into autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Jan 14, 2025
2 parents d1dc84b + b3fe994 commit 4dfe9d0
Show file tree
Hide file tree
Showing 207 changed files with 5,436 additions and 1,232 deletions.
3 changes: 1 addition & 2 deletions .config/mill-version
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
0.12.4-23-2ff492

0.12.5-68-e4bf78-native
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ Please don't open issues for questions, but ask in our Discussions forum at http

Mill installations via `coursier` or `cs` are unsupported.

Please open all PRs as drafts to avoid being bottlenecked by Mill CI, and only
convert to ready for review once CI on your own fork is green. There will be a
PR status check linking your fork's commit/CI history for convenient viewing
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Please open all PRs as drafts and ensure that your fork of Mill has
`settings/actions` / `Allow all actions and reusable workflows` enabled to run CI on
your own fork of the Mill repo. Only once CI passes mark the PR as `Ready for review`
and CI will run on the main Mill repo before we merge it.
6 changes: 2 additions & 4 deletions .github/actions/post-build-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: temurin
- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
shell: bash

# Need to fix cached artifact file permissions because github actions screws it up
# https://github.com/actions/upload-artifact/issues/38
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/draft-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Draft CI

permissions: write-all
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
run:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Debug Echos
run: |
echo ${{ github.event.action }}
echo ${{ github.event.action == 'ready_for_review' }}
echo "${{ github.event.pull_request.head.repo.html_url }}/commits/${{github.event.pull_request.head.ref}}"
- name: Create status
run: |
curl --request POST \
--url ${{ github.event.pull_request.statuses_url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'pending' || 'success'}}",
"context": "Draft CI / link",
"target_url": ${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && format('"{0}/commits/{1}"', github.event.pull_request.head.repo.html_url, github.event.pull_request.head.ref) || 'null'}},
"description": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'use CI on your repo fork (link on right) until this PR is ready for review' || 'PR is ready for review, running CI in Mill repo'}}"
}' \
--fail-with-body
15 changes: 15 additions & 0 deletions .github/workflows/post-build-selective.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
millargs:
default: ''
type: string
coursierarchive:
default: ''
type: string
java-version:
required: true
type: string
Expand Down Expand Up @@ -60,13 +63,25 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Cleanup any previous avd's to avoid signing key conflicts
if : ${{ inputs.install-android-sdk }}
run: rm -rf /home/runner/.config/.android/avd

- name: Set AVD environment variable globally
if: ${{ inputs.install-android-sdk }}
run: echo "ANDROID_AVD_HOME=/home/runner/.config/.android/avd" >> $GITHUB_ENV

- run: ./mill -i -k selective.resolve ${{ inputs.millargs }}

- run: ./mill -i -j1 -k selective.run ${{ inputs.millargs }}
if: ${{ inputs.install-android-sdk }}
env:
COURSIER_ARCHIVE_CACHE: ${{ inputs.coursierarchive }}

- run: ./mill -i -k selective.run ${{ inputs.millargs }}
if: ${{ !inputs.install-android-sdk }}
env:
COURSIER_ARCHIVE_CACHE: ${{ inputs.coursierarchive }}

- run: 'taskkill -f -im java* && rm -rf out/mill-server/*'
if: startsWith(inputs.os, 'windows')
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pre-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ jobs:
with:
ref: ${{ github.base_ref }}

- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version

- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact

- run: mkdir out && touch out/mill-selective-execution.json
shell: bash

- run: cat .mill-jvm-version

- run: ./mill -i -k selective.prepare ${{ inputs.prepareargs }}
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}

- uses: actions/upload-artifact@v4.5.0
- uses: actions/upload-artifact@v4.6.0
with:
path: out/mill-selective-execution.json
name: ${{ inputs.os }}-selective-execution-artifact
Expand All @@ -50,7 +54,7 @@ jobs:

- run: ./mill -i -k ${{ inputs.compileargs }}

- uses: actions/upload-artifact@v4.5.0
- uses: actions/upload-artifact@v4.6.0
with:
path: .
name: ${{ inputs.os }}-artifact
Expand Down
58 changes: 39 additions & 19 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ on:
- '**'
workflow_dispatch:

# cancel older runs of a pull request;
# this will not cancel anything for normal git pushes
concurrency:
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build-artifacts:
# when in master repo, publish all tags and manual runs on main
Expand All @@ -33,14 +27,11 @@ jobs:

- uses: coursier/cache-action@v6

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin
- run: "echo temurin:11 > .mill-jvm-version"

- run: ./mill -i __.publishArtifacts

- uses: actions/upload-artifact@v4.5.0
- uses: actions/upload-artifact@v4.6.0
with:
path: .
include-hidden-files: true
Expand Down Expand Up @@ -81,13 +72,45 @@ jobs:

- uses: coursier/cache-action@v6

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin
- run: "echo temurin:11 > .mill-jvm-version"

- 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'
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-${{ matrix.os }}-${{ github.sha }}
strategy:
matrix:
include:
- os: macos-latest
coursierarchive: ""
- os: windows-latest
coursierarchive: C:/coursier-arc
# Skip this because the main publishing job handles it
# - 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"
COURSIER_ARCHIVE_CACHE: ${{ matrix.coursierarchive }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }

- run: "echo temurin:11 > .mill-jvm-version"

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

release-github:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill'
Expand All @@ -113,9 +136,6 @@ jobs:

- uses: coursier/cache-action@v6

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin
- run: "echo temurin:11 > .mill-jvm-version"

- run: ./mill -i dist.uploadToGithub --authKey $REPO_ACCESS_TOKEN
6 changes: 1 addition & 5 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
# old runs since any newer run renders older ones irrelevant
concurrency:
group: publish-docs
cancel-in-progress: true

jobs:
publishDocs:
Expand All @@ -27,9 +26,6 @@ jobs:

- uses: coursier/cache-action@v6

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin
- run: "echo temurin:11 > .mill-jvm-version"

- run: ci/publish-docs.sh
Loading

0 comments on commit 4dfe9d0

Please sign in to comment.