-
Notifications
You must be signed in to change notification settings - Fork 5
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 #17 from uzzu/change-dotenv-file
Add changing dotenv file feature
- Loading branch information
Showing
21 changed files
with
673 additions
and
59 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 |
---|---|---|
|
@@ -7,28 +7,33 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 11 | ||
- name: Gradle clean | ||
run: | | ||
./gradlew clean | ||
- name: Gradle build | ||
run: | | ||
./gradlew build | ||
- name: Gradle publish to mavenLocal | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- name: Run basic example | ||
run: | | ||
cd examples/basic | ||
./gradlew clean --refresh-dependencies | ||
- name: Upload build report | ||
uses: actions/[email protected] | ||
with: | ||
name: build_reports | ||
path: plugin/build/reports | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 11 | ||
- name: Gradle clean | ||
run: | | ||
./gradlew clean | ||
- name: Gradle build | ||
run: | | ||
./gradlew build | ||
- name: Gradle publish to mavenLocal | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- name: Run basic example | ||
run: | | ||
cd examples/basic | ||
./gradlew clean --refresh-dependencies | ||
- name: Run change file example | ||
run: | | ||
cd examples/change_file | ||
./gradlew clean --refresh-dependencies | ||
ENV_FILE=.env.staging ./gradlew clean | ||
- name: Upload build report | ||
uses: actions/[email protected] | ||
with: | ||
name: build_reports | ||
path: plugin/build/reports |
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,39 @@ | ||
name: Publish | ||
on: | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 11 | ||
- name: Set env | ||
run: | | ||
echo 'GRADLE_PUBLISH_KEY=${{ secrets.GRADLE_PUBLISH_KEY }}' >> $GITHUB_ENV | ||
echo 'GRADLE_PUBLISH_SECRET=${{ secrets.GRADLE_PUBLISH_SECRET }}' >> $GITHUB_ENV | ||
- name: Gradle clean | ||
run: | | ||
./gradlew clean | ||
- name: Gradle build | ||
run: | | ||
./gradlew build | ||
- name: Gradle publish to mavenLocal | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- name: Run basic example | ||
run: | | ||
cd examples/basic | ||
./gradlew clean --refresh-dependencies | ||
pushd | ||
- name: publish | ||
run: | | ||
PUBLISH_PRODUCTION=1 ./gradlew publishPlugins | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 11 | ||
- name: Set env | ||
run: | | ||
echo 'GRADLE_PUBLISH_KEY=${{ secrets.GRADLE_PUBLISH_KEY }}' >> $GITHUB_ENV | ||
echo 'GRADLE_PUBLISH_SECRET=${{ secrets.GRADLE_PUBLISH_SECRET }}' >> $GITHUB_ENV | ||
- name: Gradle clean | ||
run: | | ||
./gradlew clean | ||
- name: Gradle build | ||
run: | | ||
./gradlew build | ||
- name: Gradle publish to mavenLocal | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- name: Run basic example | ||
run: | | ||
cd examples/basic | ||
./gradlew clean --refresh-dependencies | ||
- name: Run change file example | ||
run: | | ||
cd examples/change_file | ||
./gradlew clean --refresh-dependencies | ||
ENV_FILE=.env.staging ./gradlew clean | ||
- name: publish | ||
run: | | ||
PUBLISH_PRODUCTION=1 ./gradlew publishPlugins |
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,6 +1,6 @@ | ||
name: pull-request-build | ||
|
||
on: [pull_request] | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -36,6 +36,11 @@ jobs: | |
run: | | ||
cd examples/basic | ||
./gradlew clean --refresh-dependencies | ||
- name: Run change file example | ||
run: | | ||
cd examples/change_file | ||
./gradlew clean --refresh-dependencies | ||
ENV_FILE=.env.staging ./gradlew clean | ||
- name: Upload build report | ||
uses: actions/[email protected] | ||
with: | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
FOO=default |
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 @@ | ||
FOO=staging |
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 @@ | ||
FOO= |
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,6 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
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,5 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
|
||
# Ignore Gradle build output directory | ||
build |
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,6 @@ | ||
## Change file example | ||
|
||
Run the following command to confirm that the DotEnv file to be loaded has changed. | ||
|
||
- `./gradlew clean` | ||
- `ENV_FILE=.env.staging ./gradlew clean` |
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,6 @@ | ||
plugins { | ||
base | ||
id("co.uzzu.dotenv.gradle") version "1.1.0" | ||
} | ||
|
||
println(env.FOO.value) |
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
examples/change_file/gradle/wrapper/gradle-wrapper.properties
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,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.