Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To remove duplicate workflow config.
- Loading branch information
Showing
5 changed files
with
118 additions
and
242 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Maven build | ||
on: | ||
workflow_call: | ||
env: | ||
JAVA_TOOL_OPTIONS: >- | ||
-XX:TieredStopAtLevel=1 | ||
-XX:+UseParallelGC | ||
-Dstyle.color=always | ||
-Djansi.force=true | ||
jobs: | ||
build: | ||
name: Maven build | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
maven-version: | ||
- '3.3.9' | ||
- '3.6.1' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 8 | ||
distribution: 'temurin' | ||
# Since code changes to this project are infrequent, and most commits | ||
# change the pom.xml, we cache by date interval rather than file hash. | ||
- name: Calculate cache interval | ||
run: | | ||
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")" | ||
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))" | ||
id: cache-interval | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
!~/.m2/repository/com/github/gantsign/maven | ||
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }} | ||
- name: Build with Maven | ||
run: .github/scripts/build.sh | ||
env: | ||
MAVEN_VERSION: ${{ matrix.maven-version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Code coverage report | ||
if: matrix.maven-version == '3.6.1' | ||
uses: codecov/codecov-action@v3.1.0 |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Maven deploy | ||
on: | ||
workflow_call: | ||
env: | ||
JAVA_TOOL_OPTIONS: >- | ||
-XX:TieredStopAtLevel=1 | ||
-XX:+UseParallelGC | ||
-Dstyle.color=always | ||
-Djansi.force=true | ||
jobs: | ||
deploy: | ||
name: Maven deploy | ||
runs-on: ubuntu-20.04 | ||
if: github.repository == 'gantsign/ktlint-maven-plugin' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 8 | ||
distribution: 'temurin' | ||
# Since code changes to this project are infrequent, and most commits | ||
# change the pom.xml, we cache by date interval rather than file hash. | ||
- name: Calculate cache interval | ||
run: | | ||
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")" | ||
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))" | ||
id: cache-interval | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
!~/.m2/repository/com/github/gantsign/maven | ||
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy | ||
restore-keys: | | ||
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }} | ||
- name: Install GPG key | ||
run: |- | ||
gpg --batch --import-options import-show --import << EOF | ||
${{ secrets.GPG_KEY }} | ||
EOF | ||
- name: Deploy with Maven | ||
run: .github/scripts/deploy.sh | ||
env: | ||
OSSRH_USER: ${{ secrets.OSSRH_USER }} | ||
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} | ||
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Delete GPG secret key | ||
if: ${{ always() }} | ||
run: gpg --batch --yes --delete-secret-keys ${{ secrets.GPG_KEY_NAME }} || true | ||
- name: Delete GPG public key | ||
if: ${{ always() }} | ||
run: gpg --batch --yes --delete-keys ${{ secrets.GPG_KEY_NAME }} |
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
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