Skip to content

Commit

Permalink
Revert "chore: standardization to platform-actions (#205)" (#210)
Browse files Browse the repository at this point in the history
This reverts commit 3ef0086.
  • Loading branch information
marianogoldman authored Jun 15, 2023
1 parent d6b744a commit 89c1f9e
Show file tree
Hide file tree
Showing 8 changed files with 10,062 additions and 2,871 deletions.
87 changes: 70 additions & 17 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,76 @@
name: build and publish

on:
push:
branches:
- main
pull_request:
release:
types:
- created


jobs:
build-publish:
uses: decentraland/platform-actions/.github/workflows/libs-build-and-publish.yml@main
secrets:
SDK_TEAM_S3_BUCKET: ${{ secrets.SDK_TEAM_S3_BUCKET }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_URL: ${{ secrets.GITLAB_URL }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SDK_TEAM_AWS_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
SDK_TEAM_AWS_SECRET: ${{ secrets.SDK_TEAM_AWS_SECRET }}
SDK_TEAM_S3_BASE_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}
check_and_build:
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
s3_bucket_key: ${{ steps.publish_package.outputs.s3-bucket-key }}
steps:
- uses: actions/checkout@v3
- name: install
run: npm ci
- name: build
run: npm run build
- name: test
run: npm run test
- name: validate
run: npm run lint
- name: check-api
run: npm run check-api
- 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
npm upgrade "${{ steps.url-generator.outputs.body }}"
```
edit-mode: replace
42 changes: 42 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- master
- main
tags:
- '*'
release:
types:
- created

name: Publish NPM package
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- name: npm run test
run: npm run test
- name: npm run lint
run: npm run lint
- name: npm run check-api
run: npm run check-api
- name: print diff if failed
if: ${{ failure() }}
run: cp temp/schemas.api.md report/schemas.api.md && git diff

- name: Publish
uses: menduz/oddish-action@master
with:
access: public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
branches-ignore:
- "master"
- "main"
pull_request:

name: PR Validation
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- name: npm run test
run: npm run test
- name: npm run lint
run: npm run lint
- name: npm run check-api
run: npm run check-api
- name: print diff if failed
if: ${{ failure() }}
run: cp temp/schemas.api.md report/schemas.api.md && git diff
9 changes: 0 additions & 9 deletions .github/workflows/validate-pr-title.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.0
v16.13.0
Loading

0 comments on commit 89c1f9e

Please sign in to comment.