From 035f1df517539b931763b12a5e7d4635d0f9cf66 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 12 Sep 2024 16:55:36 +0800 Subject: [PATCH] more github actions refactoring --- .github/workflows/publish-artifacts.yml | 51 ++++++++++++++++++------ .github/workflows/publish-docs.yml | 28 ------------- .github/workflows/publish-executable.yml | 25 ------------ .github/workflows/publish.yml | 25 ------------ 4 files changed, 39 insertions(+), 90 deletions(-) delete mode 100644 .github/workflows/publish-docs.yml delete mode 100644 .github/workflows/publish-executable.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish-artifacts.yml b/.github/workflows/publish-artifacts.yml index 4e39fcaea..0f2604ed1 100644 --- a/.github/workflows/publish-artifacts.yml +++ b/.github/workflows/publish-artifacts.yml @@ -1,18 +1,13 @@ -name: Publish Artifacts +name: Release + on: - workflow_call: - secrets: - SONATYPE_PGP_SECRET: - required: true - SONATYPE_DEPLOY_USER: - required: true - SONATYPE_DEPLOY_PASSWORD: - required: true - SONATYPE_PGP_PASSWORD: - required: true + push: + tags: + - '**' + workflow_dispatch: jobs: - release: + publish-maven: strategy: matrix: shard: [ 1, 2, 3, 4, 5, 6] @@ -36,3 +31,35 @@ jobs: distribution: temurin - run: test -z "$SONATYPE_PGP_PRIVATE_KEY" || echo "$SONATYPE_PGP_PRIVATE_KEY" | base64 --decode | gpg --import --no-tty --batch --yes - run: GPG_TTY=$(tty) ./mill -i publishSonatype __.publishArtifacts --shard ${{ matrix.shard }} --divisionCount 6 + + publish-docs: + runs-on: ubuntu-latest + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: temurin + - name: publish docs + shell: 'script -q -e -c "bash {0}"' + run: echo "Hello World" && ./mill -i publishDocs + env: + TERM: xterm-256color + + publish-executable: + runs-on: ubuntu-latest + env: + AMMONITE_BOT_AUTH_TOKEN: ${{ secrets.AMMONITE_BOT_AUTH_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: temurin + - run: ./mill -i publishExecutable diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml deleted file mode 100644 index ee09a9841..000000000 --- a/.github/workflows/publish-docs.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish Docs -on: -# push: -# branches: -# - main - workflow_call: - secrets: - DEPLOY_KEY: - required: true - -jobs: - publishDocs: - runs-on: ubuntu-latest - env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: temurin - - name: publish docs - shell: 'script -q -e -c "bash {0}"' - run: echo "Hello World" && ./mill -i publishDocs - env: - TERM: xterm-256color diff --git a/.github/workflows/publish-executable.yml b/.github/workflows/publish-executable.yml deleted file mode 100644 index 9444f6603..000000000 --- a/.github/workflows/publish-executable.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish Executable -on: -# push: -# branches: -# - main -# - 2.x - workflow_call: - secrets: - AMMONITE_BOT_AUTH_TOKEN: - required: true - -jobs: - publishExecutable: - runs-on: ubuntu-latest - env: - AMMONITE_BOT_AUTH_TOKEN: ${{ secrets.AMMONITE_BOT_AUTH_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: temurin - - run: ./mill -i publishExecutable diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 9abe8589d..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release - -on: - push: - tags: - - '**' - workflow_dispatch: - -jobs: - release: - if: github.repository == 'com-lihaoyi/Ammonite' - uses: ./.github/workflows/publish-artifacts.yml - secrets: inherit - - publishDocs: - if: github.repository == 'com-lihaoyi/Ammonite' - uses: ./.github/workflows/publish-docs.yml - secrets: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - - publishExecutable: - if: github.repository == 'com-lihaoyi/Ammonite' - uses: ./.github/workflows/publish-executable.yml - secrets: - AMMONITE_BOT_AUTH_TOKEN: ${{ secrets.AMMONITE_BOT_AUTH_TOKEN }}