-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
267ccc4
commit b085fc9
Showing
5 changed files
with
143 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,114 @@ | ||
name: Build | ||
|
||
on: [pull_request, push, workflow_dispatch] | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
branches-ignore: | ||
- 'dependabot/**' | ||
- 'gh-pages' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
timeout-minutes: 15 | ||
if: | | ||
(github.event_name != 'pull_request' && !github.event.pull_request.head.repo.fork) | ||
|| (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/'))) | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Skip duplicates and docs | ||
id: skip | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
paths_ignore: '["**/README.md", "LICENSE", ".gitignore", ".editorconfig", ".idea/**"]' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate gradle wrapper | ||
if: steps.skip.outputs.should_skip != 'true' | ||
uses: gradle/wrapper-validation-action@v1 | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
|
||
- name: Setup JDK | ||
if: steps.skip.outputs.should_skip != 'true' | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
cache: gradle | ||
distribution: temurin | ||
|
||
- name: Build with gradle | ||
if: steps.skip.outputs.should_skip != 'true' | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
- name: Build | ||
run: ./gradlew build | ||
|
||
- name: Publish Test Report | ||
if: success() || failure() # run this step even if previous step failed | ||
continue-on-error: true | ||
uses: dorny/test-reporter@v1 | ||
with: | ||
name: test report | ||
path: ./**/build/test-results/test/*.xml | ||
reporter: java-junit | ||
|
||
- name: Publish Coverage Report | ||
uses: codecov/codecov-action@v4 | ||
if: | | ||
github.repository == 'coditory/gradle-integration-test-plugin' | ||
&& github.ref == 'refs/heads/master' | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
override_commit: ${{ github.event.workflow_run.head_sha }} | ||
override_branch: ${{ github.event.workflow_run.head_branch }} | ||
override_build: ${{ github.event.workflow_run.id }} | ||
disable_search: true | ||
files: build/reports/jacoco/coverage/coverage.xml | ||
|
||
- name: Import GPG Key | ||
id: gpg | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
if: | | ||
github.repository == 'coditory/gradle-integration-test-plugin' | ||
&& (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
git_committer_name: Coditory Bot | ||
git_committer_email: bot@coditory.com | ||
|
||
- name: Publish Release | ||
id: publish-release | ||
if: | | ||
github.repository == 'coditory/gradle-integration-test-plugin' | ||
&& startsWith(github.ref, 'refs/tags/v') | ||
&& (github.event_name == 'push' || github.event_name == 'workflow_dispatch') | ||
env: | ||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | ||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
run: | | ||
./gradlew publishPlugins \ | ||
-Pgradle.publish.key=$GRADLE_PUBLISH_KEY \ | ||
-Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET \ | ||
-Pversion=$NEXT_VERSION | ||
- name: Generate Release Notes | ||
id: generate-release-notes | ||
if: steps.publish-release.conclusion == 'success' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
declare -r NOTES="$(gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
/repos/${{ github.repository }}/releases/generate-notes \ | ||
-f target_commitish='master' \ | ||
-f tag_name=${GITHUB_REF_NAME:1} \ | ||
| jq -r '.body')" | ||
declare -r ESCAPED="${NOTES//$'\n'/'%0A'}" | ||
echo "notes=$ESCAPED" >> $GITHUB_OUTPUT | ||
- name: Create github release | ||
if: steps.generate-release-notes.conclusion == 'success' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
body: ${{ steps.notes.outputs.notes }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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