Fix collection of KotlinCompilation classpath using stable Kotlin Gra… #144
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
name: Publish Task | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: "${{ github.workflow }}" | |
cancel-in-progress: false | |
env: | |
# https://stackoverflow.com/a/71158878/4161471 | |
GIT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
create-m2-publication: | |
runs-on: ubuntu-latest | |
environment: | |
name: artifacts | |
url: ${{ steps.deployment.outputs.page_url }} | |
timeout-minutes: 60 | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.GIT_BRANCH_NAME }} | |
- name: setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Run publish task | |
run: >- | |
./gradlew publishAllPublicationsToGitHubPublishRepository --stacktrace --info | |
env: | |
GITHUB_PUBLISH_DIR: ${{ runner.temp }}/m2 | |
- name: upload build reports | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-report-${{ runner.os }}-${{ github.action }} | |
path: "**/build/reports/" | |
if-no-files-found: ignore | |
- name: upload local project publication | |
uses: actions/upload-artifact@v3 | |
with: | |
name: m2-publication | |
path: ${{ env.GITHUB_PUBLISH_DIR }} | |
env: | |
GITHUB_PUBLISH_DIR: ${{ runner.temp }}/m2 | |
commit-artifacts: | |
runs-on: ubuntu-latest | |
needs: create-m2-publication | |
environment: | |
name: artifacts | |
url: https://github.com/adamko-dev/dokkatoo/tree/artifacts/m2 | |
env: | |
CI_COMMIT_MESSAGE: artifacts | |
CI_COMMIT_AUTHOR: ${{ github.workflow }} | |
steps: | |
- name: Checkout artifacts branch | |
uses: actions/checkout@v3 | |
with: | |
ref: artifacts | |
- name: download local project publication | |
uses: actions/download-artifact@v3 | |
with: | |
name: m2-publication | |
path: m2 | |
- name: git push | |
run: | | |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" | |
git push |