Skip to content

Split CI workflows (#929) #1

Split CI workflows (#929)

Split CI workflows (#929) #1

name: Release Maven Central
on:
push:
branches: [main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Publish snapshot ${{ github.ref }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: nix develop --command gradle --no-daemon publishToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
- name: Publish release ${{ github.ref }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
version="${GITHUB_REF_NAME#v}"
nix develop --command gradle --no-daemon \
"-PreleaseVersion=$version" publishAndReleaseToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PGP_PASSPHRASE }}
release-cli:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: publish
permissions:
contents: write
uses: ./.github/workflows/release-cli.yaml
with:
tag: ${{ github.ref_name }}