From e6b1e71ef7883392517fbb42fca4fee8a1d00bb0 Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 14 Jun 2023 16:43:06 -0300 Subject: [PATCH 1/2] generate lib on S3 --- .github/workflows/pr.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cd480a0d..e5f2df25 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -43,3 +43,56 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: publish packages + uses: menduz/oddish-action@master + id: publish_package + with: + registry-url: 'https://registry.npmjs.org' + access: public + ## use action runId instead of current date to generate snapshot numbers + deterministic-snapshot: true + + ## publish every package to s3 + s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} + s3-bucket-key-prefix: '@dcl/${{ github.event.repository.name }}/branch/${{ github.head_ref }}' + + ## inform gitlab after publishing to proceed with CDN propagation + gitlab-token: ${{ secrets.GITLAB_TOKEN }} + gitlab-pipeline-url: ${{ secrets.GITLAB_URL }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + AWS_DEFAULT_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} + + notify_deployment: + needs: [check_and_build] + if: ${{ github.event.pull_request.number && !startsWith(github.head_ref, 'dependabot/') }} + runs-on: ubuntu-latest + name: Deployment Notification + steps: + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: Test this pull request + + - name: Generate S3 URL + id: url-generator + run: echo "body=${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.check_and_build.outputs.s3_bucket_key }}" >> $GITHUB_OUTPUT + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + # Test this pull request + - The package can be tested by running + ```bash + yarn upgrade "${{ steps.url-generator.outputs.body }}" + ``` + edit-mode: replace From abd8ec2197227a74a6a84794642206ab905b2724 Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 14 Jun 2023 16:45:57 -0300 Subject: [PATCH 2/2] Save Wed Jun 14 04:45:57 PM -03 2023 --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e5f2df25..f9a6e66d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,7 +6,7 @@ on: name: CI Validation jobs: - test: + check_and_build: runs-on: ubuntu-latest steps: - uses: actions/checkout@master