-
Notifications
You must be signed in to change notification settings - Fork 36
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 #68 from testfairy/feat-publish-ci
Added publishing CI
- Loading branch information
Showing
10 changed files
with
157 additions
and
65 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 45 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Build and test | ||
run: | | ||
export TF_API_KEY=${{ secrets.TF_API_KEY }} | ||
./gradlew uploadArchives | ||
cd example/TestApplication | ||
./gradlew testfairyDebug | ||
shell: bash |
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,91 @@ | ||
name: Publish plugin to testfairy-maven repo as a PR | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Setup Github CLI and login | ||
run: | | ||
sudo apt install -y gh | ||
echo ${{ secrets.MAVEN_GH_SSH_KEY_BASE64 }} | base64 --decode > ghkey | ||
# sudo chmod 600 ghkey | ||
# eval `ssh-agent -s` | ||
# ssh-add ghkey | ||
echo ${{ secrets.MAVEN_GH_TOKEN }} > maven-token | ||
gh auth login --with-token < maven-token | ||
export MAVEN_GH_SSH_KEY=`cat ghkey` | ||
shell: bash | ||
|
||
- name: Check out testfairy-maven | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: testfairy/testfairy-maven | ||
token: ${{ secrets.MAVEN_GH_TOKEN }} | ||
ssh-key: ${{ env.MAVEN_GH_SSH_KEY }} | ||
path: './testfairy-maven' | ||
|
||
- name: Build | ||
run: | | ||
export TF_API_KEY=${{ secrets.TF_API_KEY }} | ||
echo "TF_GRADLE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
export TF_GRADLE_VERSION=${GITHUB_REF#refs/*/} | ||
./gradlew uploadArchives | ||
shell: bash | ||
|
||
- name: Upload release artifacts | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Version ${{ env.TF_GRADLE_VERSION }} | ||
tag_name: ${{ env.TF_GRADLE_VERSION }} | ||
fail_on_unmatched_files: true | ||
prerelease: false | ||
files: | | ||
testfairy-maven/com/testfairy/plugins/gradle/testfairy/${{ env.TF_GRADLE_VERSION }}/testfairy-${{ env.TF_GRADLE_VERSION }}.jar | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to testfairy-maven | ||
run: | | ||
if [ "$TF_GRADLE_VERSION" == "HEAD" ]; then | ||
echo "Cannot publish HEAD. Please use proper semver in your release." | ||
exit 1 | ||
fi | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "testfairy-maven-publish" | ||
cd testfairy-maven | ||
GIT_BRANCH="publish-gradle-$TF_GRADLE_VERSION" | ||
git branch $GIT_BRANCH | ||
git checkout $GIT_BRANCH | ||
git add * | ||
git commit -m "Publishing TestFairy Gradle Plugin $TF_GRADLE_VERSION" | ||
git push -u origin $GIT_BRANCH | ||
gh pr create --title "Publishing TestFairy Gradle Plugin $TF_GRADLE_VERSION" --body "$TF_GRADLE_VERSION" | ||
shell: bash | ||
|
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ composer.lock | |
/build | ||
/captures | ||
.externalNativeBuild | ||
repo/com |
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
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
26 changes: 0 additions & 26 deletions
26
...ication/app/src/androidTest/java/com/example/testapplication/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Empty file.