-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from stewartbryson/stewart
Implement release-drafter.
- Loading branch information
Showing
6 changed files
with
134 additions
and
156 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,63 +1,86 @@ | ||
name: Run Gradle on PRs | ||
name: Gradle Pull Request | ||
|
||
on: | ||
pull_request | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- main | ||
# pull_request event is required only for autolabeler | ||
pull_request: | ||
# Only following types are handled by the action, but one can default to all as well | ||
types: [opened, reopened, synchronize] | ||
# pull_request_target event is required for autolabeler to support PRs from forks | ||
# pull_request_target: | ||
# types: [opened, reopened, synchronize] | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
|
||
jobs: | ||
gradle_build: | ||
gradle-pr: | ||
permissions: | ||
# write permission is required to create a GitHub release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
# for publish-tests | ||
checks: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# - id: echo_environment | ||
# run: ./echo-environment.sh | ||
# name: "Echo environment" | ||
# shell: bash | ||
|
||
- id: gradle_properties | ||
- name: Write gradle.properties file | ||
id: gradle-properties | ||
run: | | ||
mkdir -p $HOME/.gradle | ||
echo "$GRADLE_PROPERTIES" > $HOME/.gradle/gradle.properties | ||
name: 'Write gradle.properties file' | ||
shell: bash | ||
env: | ||
GRADLE_PROPERTIES: ${{secrets.GRADLE_PROPERTIES}} | ||
|
||
- id: credentials_file | ||
- name: Write .snowflake/config.toml file | ||
id: credentials-file | ||
run: | | ||
mkdir -p $HOME/.snowflake | ||
echo "$SNOW_CONFIG" > $HOME/.snowflake/config.toml | ||
name: 'Write .snowflake/config.toml file' | ||
shell: bash | ||
env: | ||
SNOW_CONFIG: ${{secrets.SNOW_CONFIG}} | ||
|
||
- id: google_auth | ||
name: 'Authenticate to Google Cloud' | ||
- name: Authenticate to Google Cloud | ||
id: google-auth | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | ||
|
||
- id: gradle_build | ||
name: Gradle build and test | ||
- name: Gradle build and test | ||
id: gradle-build | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: build validatePlugin functionalTest integrationTest buildDashboard --scan -S | ||
cache-read-only: ${{ github.base_ref == 'main' }} | ||
|
||
- id: publish_tests | ||
name: Publish tests | ||
- name: Publish tests | ||
id: publish-tests | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
|
||
run_example: | ||
- name: Create a draft release from PR. | ||
id: release-draft | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
commitish: main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
run-example: | ||
#if: ${{ false }} # disable for now | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -70,20 +93,20 @@ jobs: | |
# Should really make these reusable | ||
- uses: actions/checkout@v3 | ||
|
||
- id: gradle_properties | ||
- name: Write gradle.properties file | ||
id: gradle-properties | ||
run: | | ||
mkdir -p $HOME/.gradle | ||
echo "$GRADLE_PROPERTIES" > $HOME/.gradle/gradle.properties | ||
name: 'Write gradle.properties file' | ||
shell: bash | ||
env: | ||
GRADLE_PROPERTIES: ${{secrets.GRADLE_PROPERTIES}} | ||
|
||
- id: credentials_file | ||
- name: Write .snowflake/config.toml file | ||
id: credentials-file | ||
run: | | ||
mkdir -p $HOME/.snowflake | ||
echo "$SNOW_CONFIG" > $HOME/.snowflake/config.toml | ||
name: 'Write .snowflake/config.toml file' | ||
shell: bash | ||
env: | ||
SNOW_CONFIG: ${{secrets.SNOW_CONFIG}} | ||
|
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Gradle Release | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
|
||
jobs: | ||
gradle-release: | ||
if: ${{ github.event.pull_request.merged }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Write gradle.properties file | ||
id: gradle-properties | ||
run: | | ||
mkdir -p $HOME/.gradle | ||
echo "$GRADLE_PROPERTIES" > $HOME/.gradle/gradle.properties | ||
shell: bash | ||
env: | ||
GRADLE_PROPERTIES: ${{secrets.GRADLE_PROPERTIES}} | ||
|
||
- name: Write .snowflake/config.toml file | ||
id: credentials-file | ||
run: | | ||
mkdir -p $HOME/.snowflake | ||
echo "$SNOW_CONFIG" > $HOME/.snowflake/config.toml | ||
shell: bash | ||
env: | ||
SNOW_CONFIG: ${{secrets.SNOW_CONFIG}} | ||
|
||
- name: Authenticate to Google Cloud | ||
id: google-auth | ||
uses: google-github-actions/auth@v0 | ||
with: | ||
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
|
||
- name: Set Values | ||
id: set-values | ||
run: | | ||
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | ||
- name: Echo Version | ||
id: echo-version | ||
run: | | ||
echo ${{ steps.set-values.outputs.version }} | ||
- name: Gradle publish | ||
id: gradle-publish | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: build validatePlugin publish examples buildDashboard -Pversion=${{ steps.set-values.outputs.version }} -S --scan | ||
|
||
- name: Publish tests | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() | ||
with: | ||
report_paths: '**/build/test-results/**/TEST-*.xml' | ||
|
||
- name: Upload binaries to release | ||
id: upload-binaries | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: '**/build/libs/*.jar' | ||
asset_name: gradle-plugin | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
|
||
- name: Update Documentation | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Updating README and examples. | ||
branch: main | ||
file_pattern: 'README.md examples/*.gradle' | ||
status_options: '--untracked-files=no' |
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 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,3 +1,4 @@ | ||
internalStage=upload | ||
s3Stage=s3_maven | ||
gcsStage=gcs_maven | ||
version=1.0.0 |