Skip to content

Commit

Permalink
More cleanups for github actions (#3484)
Browse files Browse the repository at this point in the history
- Only trigger `Publish Artifacts` on tags and explicit
`workflow_dispatch`
- Remove redundant job conditionals
- Don't both running tests on tags since they already run on the commits
land in the branch containing the tag
  • Loading branch information
lihaoyi authored Sep 8, 2024
1 parent 922d4ef commit b49c59e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
submit-dependency-graph:
# doesn't work on Mill 0.12.x yet
#if: github.repository == 'com-lihaoyi/mill' && github.ref == 'refs/heads/main'
if: false
runs-on: ubuntu-latest
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ name: Publish Artifacts

on:
push:
branches:
- main
tags:
- '**'
pull_request:
merge_group:
workflow_dispatch:

# cancel older runs of a pull request;
Expand All @@ -27,7 +23,7 @@ concurrency:
jobs:
publish-sonatype:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
if: github.repository == 'com-lihaoyi/mill'
runs-on: ubuntu-latest

# only run one publish job for the same sha at the same time
Expand Down Expand Up @@ -58,7 +54,7 @@ jobs:

release-github:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
if: github.repository == 'com-lihaoyi/mill'
needs: publish-sonatype
runs-on: ubuntu-latest

Expand All @@ -76,4 +72,4 @@ jobs:
java-version: '11'
distribution: temurin

- run: ./mill -i uploadToGithub $REPO_ACCESS_TOKEN
- run: ./mill -i uploadToGithub --authKey $REPO_ACCESS_TOKEN
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
jobs:
publishDocs:
if: github.repository == 'com-lihaoyi/mill' && github.ref == 'refs/heads/main'
if: github.repository == 'com-lihaoyi/mill'
runs-on: ubuntu-latest
env:
REPO_DEPLOY_KEY: ${{ secrets.REPO_DEPLOY_KEY }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ on:
push:
branches:
- main
tags:
- '**'
pull_request:
merge_group:
workflow_dispatch:

# cancel older runs of a pull request;
Expand Down
2 changes: 0 additions & 2 deletions ci/release-bridge-maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ rm gpg_key
# Build all artifacts
./mill -i __.publishArtifacts

export MILL_BUILD_COMPILER_BRIDGES=true

# Publish all artifacts
./mill -i \
mill.scalalib.PublishModule/publishAll \
Expand Down

0 comments on commit b49c59e

Please sign in to comment.