forked from com-lihaoyi/mill
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Reuse built artifacts in publish jobs (sonatype, github)
This should avoid duplicated build work. It aslo makes sure, we publish identical jars everywhere. Potentially needed GHA Job retries will be faster too. This is untested. We should do at least one manual run before we tag the next release.
- Loading branch information
Showing
2 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,33 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build-artifacts: | ||
# when in master repo, publish all tags and manual runs on main | ||
if: github.repository == 'com-lihaoyi/mill' | ||
runs-on: ubuntu-latest | ||
|
||
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 __.publishArtifacts | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
path: . | ||
include-hidden-files: true | ||
|
||
publish-sonatype: | ||
# when in master repo, publish all tags and manual runs on main | ||
if: github.repository == 'com-lihaoyi/mill' | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
|
||
# only run one publish job for the same sha at the same time | ||
|
@@ -40,8 +64,10 @@ jobs: | |
LC_ALL: "en_US.UTF-8" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: {fetch-depth: 0} | ||
- uses: actions/download-artifact@v4 | ||
if: ${{ !inputs.populate_cache }} | ||
with: | ||
path: . | ||
|
||
- uses: coursier/cache-action@v6 | ||
|
||
|
@@ -62,8 +88,10 @@ jobs: | |
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: {fetch-depth: 0} | ||
- uses: actions/download-artifact@v4 | ||
if: ${{ !inputs.populate_cache }} | ||
with: | ||
path: . | ||
|
||
- uses: coursier/cache-action@v6 | ||
|
||
|
This file contains 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