-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
129 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,146 +5,83 @@ on: | |
branches-ignore: | ||
- 'autodelivery**' | ||
- 'bump-**' | ||
- 'renovate/**' | ||
paths-ignore: | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- 'LICENSE' | ||
pull_request: | ||
schedule: | ||
- cron: '0 3 * * SUN' | ||
|
||
jobs: | ||
Build: | ||
strategy: | ||
matrix: | ||
os: [windows, macos, ubuntu] | ||
jvm_version: [8, 11, 15, 16] | ||
distribution: [adopt] | ||
runs-on: ${{ matrix.os }}-latest | ||
env: | ||
JAVA_VERSION: ${{ matrix.jvm_version }} | ||
OS: ${{ matrix.os }} | ||
TERM: dumb | ||
steps: | ||
# Checkout the repository | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Fetch tags | ||
shell: bash | ||
run: git fetch --tags -f | ||
- name: Populate TAG and BRANCH environment variables | ||
shell: bash | ||
run: | | ||
TAG=$(git describe --tags --exact-match HEAD || echo '') | ||
echo "Current tag is: '$TAG' (setup in the TAG environment variable)" | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
BRANCH=$([ -z "$TAG" ] && echo ${GITHUB_REF#refs/heads/} || echo $TAG) | ||
echo "Current tag is: '$BRANCH' (setup in BRANCH TAG environment variable)" | ||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV | ||
# Check if the configuration is supported | ||
# COMPATIBLE means the build can run on this matrix combination | ||
# REFERENCE means this is the combination that produces the reference artifacts | ||
# (hence, artifacts from REFERENCE configuration shall be deployed) | ||
# Only one matrix entry should be REFERENCE=true | ||
# If REFERENCE=true, then also COMPATIBLE=true | ||
- shell: bash | ||
run: .github/build-steps/compatibility_check.sh | ||
uses: danysk/[email protected] | ||
# Install the JDK | ||
- uses: actions/setup-java@v2 | ||
if: ${{ env.COMPATIBLE == 'true' }} | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
java-version: ${{ matrix.jvm_version }} | ||
distribution: adopt | ||
java-version: 16 | ||
server-id: ossrh | ||
server-username: MAVEN_CENTRAL_USERNAME | ||
server-password: MAVEN_CENTRAL_PASSWORD | ||
gpg-private-key: ${{ secrets.SIGNING_KEY }} | ||
gpg-passphrase: SIGNING_PASSWORD | ||
# Install additional packages | ||
- name: Configure Linux | ||
shell: bash | ||
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'ubuntu') }} | ||
run: | | ||
if [ -x .github/scripts/configure_linux ]; then | ||
.github/scripts/configure_linux | ||
fi | ||
- name: Configure MacOS X | ||
shell: bash | ||
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'macos') }} | ||
run: | | ||
if [ -f .github/scripts/configure_macos ]; then | ||
.github/scripts/configure_macos | ||
fi | ||
- name: Configure the Windows Pagefile | ||
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'windows') }} | ||
if: ${{ runner.os == 'Windows' }} | ||
uses: al-cheb/[email protected] | ||
- name: Configure Windows | ||
shell: bash | ||
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'windows') }} | ||
run: | | ||
if [ -f .github/scripts/configure_windows ]; then | ||
.github/scripts/configure_windows | ||
fi | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build | ||
if: ${{ env.COMPATIBLE == 'true' }} | ||
shell: bash | ||
run: .github/build-steps/build.sh || .github/build-steps/build.sh | ||
run: ./gradlew assemble | ||
- name: Check | ||
if: ${{ env.COMPATIBLE == 'true' }} | ||
shell: bash | ||
run: .github/build-steps/check.sh || .github/build-steps/check.sh | ||
run: ./gradlew check --parallel | ||
- name: CodeCov | ||
if: ${{ env.REFERENCE == 'true' }} | ||
uses: codecov/codecov-action@v1 | ||
if: ${{ runner.os == 'Linux' }} | ||
uses: codecov/codecov-action@v2 | ||
- name: Deploy | ||
if: ${{ env.REFERENCE == 'true' && github.event_name == 'push' }} | ||
if: ${{ runner.os == 'Linux' && github.event_name == 'push' }} | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
githubToken: ${{ secrets.AUTOMERGE_TOKEN }} | ||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | ||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | ||
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
MAVEN_CENTRAL_USERNAME: danysk | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | ||
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | ||
run: .github/build-steps/deploy.sh || .github/build-steps/deploy.sh | ||
Build-Success: | ||
runs-on: ubuntu-latest | ||
needs: Build | ||
steps: | ||
- shell: bash | ||
run: touch ok | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: success | ||
path: ok | ||
CI-Complete: | ||
needs: Build-Success | ||
if: always() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: success | ||
- shell: bash | ||
run: '[ -f ok ]' | ||
Automerge: | ||
needs: CI-Complete | ||
runs-on: ubuntu-latest | ||
if: success() | ||
steps: | ||
- name: automerge | ||
uses: "DanySK/yaagha@master" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.AUTOMERGE_TOKEN }}" | ||
MERGE_FORKS: "false" | ||
MERGE_LABELS: "version-upgrade" | ||
BLOCK_LABELS: "blocked, wontfix, invalid" | ||
MERGE_METHOD: "rebase" | ||
CLOSE_ON_CONFLICT: "true" | ||
DELETE_BRANCH_ON_CLOSE: "true" | ||
GIT_USER_NAME: "Danilo Pianini" | ||
GIT_USER_EMAIL: "[email protected]" | ||
run: | | ||
./gradlew publishPluginMavenPublicationToMavenCentralRepository publishKotlinMavenPublicationToMavenCentralRepository | ||
./gradlew publishPluginMavenPublicationToGithubRepository || true | ||
./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET || true | ||
- name: Turn off the Gradle Daemon | ||
shell: bash | ||
run: ./gradlew --stop | ||
- name: Cleanup the Gradle cache | ||
if: ${{ runner.os != 'Windows' }} | ||
shell: bash | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
- name: Force the Gradle cleanup on Windows | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
Remove-Item -Force c:\Users\runneradmin\.gradle\caches\modules-2\modules-2.lock | ||
Remove-Item -Force c:\Users\runneradmin\.gradle\caches\modules-2\gc.properties |