Skip to content

Commit

Permalink
CI: only publish anything when tests are successful
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Mar 4, 2024
1 parent 50d39ec commit 2787bd5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 12 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
- run: ./mill -i unitTest "${{ matrix.scala-binary-version }}"

itest:
strategy:
fail-fast: false
Expand All @@ -43,6 +44,7 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
- run: ./mill -i integrationTest ${{ matrix.scala-version }}

publishLocal:
strategy:
fail-fast: false
Expand All @@ -57,3 +59,23 @@ jobs:
with:
java-version: 8
- run: ./mill -i __[${{ matrix.scala-version }}].__.publishLocal

release:
if: github.repository == 'com-lihaoyi/Ammonite' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.x')
needs: [ test, itest, publishLocal ]
uses: ./.github/workflows/release.yml
secrets: inherit

publishDosc:
if: github.repository == 'com-lihaoyi/Ammonite' && github.ref == 'refs/heads/main'
needs: [ test, itest ]
uses: ./.github/workflows/publishDocs.yml
secrets:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

publishExecutable:
if: github.repository == 'com-lihaoyi/Ammonite' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.x')
needs: [ test, itest ]
uses: ./.github/workflows/publishDocs.yml
secrets:
AMMONITE_BOT_AUTH_TOKEN: ${{ secrets.AMMONITE_BOT_AUTH_TOKEN }}
11 changes: 8 additions & 3 deletions .github/workflows/publishDocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Publish Docs
on:
push:
branches:
- main
# push:
# branches:
# - main
workflow_call:
secrets:
DEPLOY_KEY:
required: true

jobs:
publishDocs:
runs-on: ubuntu-latest
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/publishExecutable.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Publish Executable
on:
push:
branches:
- main
- 2.x
# push:
# branches:
# - main
# - 2.x
workflow_call:
secrets:
AMMONITE_BOT_AUTH_TOKEN:
required: true

jobs:
publishExecutable:
runs-on: ubuntu-latest
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: Release
on:
push:
branches:
- main
- 2.x
# push:
# branches:
# - main
# - 2.x
workflow_call:
secrets:
SONATYPE_PGP_SECRET:
required: true
SONATYPE_DEPLOY_USER:
required: true
SONATYPE_DEPLOY_PASSWORD:
required: true
SONATYPE_PGP_PASSWORD:
required: true

jobs:
release:
strategy:
matrix:
shard: [1, 2, 3, 4, 5]
shard: [ 1, 2, 3, 4, 5 ]
fail-fast: false
runs-on: ubuntu-latest
env:
Expand Down

0 comments on commit 2787bd5

Please sign in to comment.