From 3001cf2ecbdaca721edb79986e6c926cdc8fbc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estiven=20S=C3=A1nchez?= Date: Mon, 27 Nov 2023 17:51:53 -0500 Subject: [PATCH 1/3] Update workflows --- .github/workflows/build.yml | 10 +++++----- .github/workflows/code-coverage.yml | 2 +- .github/workflows/documentation.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae27c15..e313be9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ env: jobs: build-library: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -73,7 +73,7 @@ jobs: name: code-coverage-report-${{ github.job }} path: "**/build/reports/**/*" check-sample-android-app: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') needs: build-library runs-on: ubuntu-latest steps: @@ -85,7 +85,7 @@ jobs: target: androidapp githubToken: ${{ secrets.GITHUB_TOKEN }} check-sample-desktop-app: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') needs: build-library runs-on: ubuntu-latest steps: @@ -97,7 +97,7 @@ jobs: target: desktopApp githubToken: ${{ secrets.GITHUB_TOKEN }} check-sample-wear-app: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') needs: build-library runs-on: ubuntu-latest steps: @@ -109,7 +109,7 @@ jobs: target: wearapp githubToken: ${{ secrets.GITHUB_TOKEN }} check-sample-web-app: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + # if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') needs: build-library runs-on: ubuntu-latest steps: diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index e44d983..748a68f 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -21,7 +21,7 @@ permissions: jobs: build: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') name: Build and analyze runs-on: self-hosted steps: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ea13783..5f93b4c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ env: jobs: build-documentation: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') runs-on: ubuntu-latest steps: - name: Checkout repository @@ -65,7 +65,7 @@ jobs: instance: ${{ env.INSTANCE }} deploy-documentation: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + # if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e4ff95..e10a189 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ env: jobs: pre-build: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + #if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') name: Publish library at mavenCentral runs-on: self-hosted steps: @@ -54,7 +54,7 @@ jobs: - name: Publish library run: ./gradlew publish --no-parallel release: - if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') + # if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'samples/') name: Create release v${{ github.event.inputs.version }} needs: pre-build runs-on: self-hosted From 1634ba5b3ce57bf659c8ce10bd2e8edb8435e7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estiven=20S=C3=A1nchez?= Date: Mon, 27 Nov 2023 17:52:21 -0500 Subject: [PATCH 2/3] Update workflows --- .github/workflows/build.yml | 5 ----- .github/workflows/code-coverage.yml | 5 ----- .github/workflows/documentation.yml | 3 --- 3 files changed, 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e313be9..970bd12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,6 @@ on: branches: - main - release/* - push: - branches: - - main - - release/* - env: OSSH_USERNAME: ${{ secrets.OSSH_USERNAME }} OSSH_PASSWORD: ${{ secrets.OSSH_PASSWORD }} diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 748a68f..d3816bd 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -1,11 +1,6 @@ name: SonarCloud verify and publish code coverage on: - push: - branches: [ "main" ] - paths-ignore: [ '**.md', '**.MD', '!docs/**' ] - tags-ignore: - - '**' pull_request: branches: [ "main" ] types: ["opened", "synchronize", "reopened"] diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 5f93b4c..0c988a0 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -4,9 +4,6 @@ on: pull_request: branches: - main - push: - branches: - - main permissions: write-all From 991edf5f9b0716b915e5f858be671dfb8822929b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estiven=20S=C3=A1nchez?= Date: Mon, 27 Nov 2023 18:02:34 -0500 Subject: [PATCH 3/3] Update replace credentials AWS --- .github/workflows/build.yml | 1 + .github/workflows/code-coverage.yml | 4 +++- .github/workflows/publish.yml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 970bd12..6a5f9f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,7 @@ jobs: AWS_SECRET_KEY_SCAPE=$(echo "$AWS_SECRET_KEY" | sed 's/[\&/]/\\&/g') sed -i -e "s/private val accessKey = .*/private val accessKey = \"$AWS_ACCESS_KEY_SCAPE\"/" -e "s/private val secretKey = .*/private val secretKey = \"$AWS_SECRET_KEY_SCAPE\"/" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt + sed -i -e "s/private val accessKey = .*/private val accessKey = \"$AWS_ACCESS_KEY_SCAPE\"/" -e "s/private val secretKey = .*/private val secretKey = \"$AWS_SECRET_KEY_SCAPE\"/" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt cat aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt working-directory: ${{ github.workspace }}/ - name: Check diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index d3816bd..60a220f 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -49,7 +49,9 @@ jobs: sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt - cat aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt + + sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt + sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt working-directory: ${{ github.workspace }}/ - name: Kover verify run: ./gradlew koverVerify diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e10a189..535b01a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,6 +47,9 @@ jobs: sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt + + sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt + sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt cat aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt working-directory: ${{ github.workspace }}/ - name: Prebuild library