-
Notifications
You must be signed in to change notification settings - Fork 1
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 #5 from decentraland/feat/add-husky-and-gh-actions
feat: Add husky and GH actions
- Loading branch information
Showing
22 changed files
with
418 additions
and
53 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
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,13 @@ | ||
name: Audit | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Install | ||
run: npm install --legacy-peer-deps | ||
- name: Audit signatures | ||
run: npm audit signatures |
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,57 @@ | ||
name: Build and release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
- name: Set package.json version | ||
uses: menduz/oddish-action@master | ||
with: | ||
deterministic-snapshot: true | ||
only-update-versions: true | ||
- name: Install | ||
run: npm install --legacy-peer-deps | ||
env: | ||
HUSKY: 0 | ||
- name: Build | ||
run: npm run build | ||
env: | ||
NODE_PATH: 'src' | ||
NODE_OPTIONS: '--max-old-space-size=6144' | ||
- name: Publish | ||
uses: menduz/oddish-action@master | ||
with: | ||
cwd: './dist' | ||
deterministic-snapshot: true | ||
provenance: false | ||
registry-url: 'https://registry.npmjs.org' | ||
access: public | ||
gitlab-token: ${{ secrets.GITLAB_CDN_DEPLOYER_TOKEN }} | ||
gitlab-pipeline-url: ${{ secrets.GITLAB_CDN_DEPLOYER_URL }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Create Sentry release | ||
if: github.event_name == 'release' && github.event.action == 'created' | ||
uses: getsentry/action-release@v1 | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | ||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
with: | ||
sourcemaps: ${{ github.workspace }}/dist | ||
version: '${{ vars.SENTRY_RELEASE_PREFIX }}@${{ github.event.release.tag_name }}' | ||
url_prefix: '~' |
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,28 @@ | ||
name: 'CodeQL' | ||
|
||
on: | ||
schedule: | ||
- cron: '59 23 * * *' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: javascript | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: '/language:javascript' |
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,45 @@ | ||
name: Set rollout - Manual | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
packageVersion: | ||
description: 'NPM Version of the release (@dcl/auth-site)' | ||
required: true | ||
default: '' | ||
deploymentDomain: | ||
type: 'choice' | ||
description: 'Deployment domain' | ||
required: true | ||
default: '.zone' | ||
options: | ||
- .zone | ||
- .today | ||
- .org | ||
rolloutPercentage: | ||
description: 'The percentage for this rollout' | ||
required: true | ||
default: '100' | ||
|
||
jobs: | ||
set-manual-rollout: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/debug-action@v2 | ||
- name: Set Rollout | ||
uses: decentraland/set-rollout-action@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Repo deployment info | ||
ref: ${{ github.event.ref }} | ||
sha: ${{ github.sha }} | ||
|
||
# CDN information | ||
packageName: '@dcl/auth-site' | ||
packageVersion: ${{ github.event.inputs.packageVersion }} | ||
|
||
# Rollout information | ||
deploymentDomain: auth.decentraland${{ github.event.inputs.deploymentDomain }} | ||
deploymentName: '_site' | ||
percentage: ${{ github.event.inputs.rolloutPercentage }} |
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,48 @@ | ||
name: Set rollout | ||
|
||
on: [deployment_status] | ||
|
||
jobs: | ||
set-rollout: | ||
if: ${{ github.event.deployment.task == 'upload-to-cdn' && github.event.deployment_status.state == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/debug-action@v2 | ||
|
||
# Dev | ||
- name: Set Rollout - Development | ||
uses: decentraland/set-rollout-action@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Repo deployment info | ||
ref: ${{ github.event.deployment.ref }} | ||
sha: ${{ github.event.deployment.sha }} | ||
|
||
# CDN information | ||
packageName: ${{ github.event.deployment.payload.packageName }} | ||
packageVersion: ${{ github.event.deployment.payload.packageVersion }} | ||
|
||
# Rollout information | ||
deploymentDomain: 'auth.decentraland.zone' | ||
deploymentName: '_site' | ||
percentage: 100 | ||
|
||
# Stg | ||
- name: Set Rollout - Staging | ||
uses: decentraland/set-rollout-action@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Repo deployment info | ||
ref: ${{ github.event.deployment.ref }} | ||
sha: ${{ github.event.deployment.sha }} | ||
|
||
# CDN information | ||
packageName: ${{ github.event.deployment.payload.packageName }} | ||
packageVersion: ${{ github.event.deployment.payload.packageVersion }} | ||
|
||
# Rollout information | ||
deploymentDomain: 'auth.decentraland.today' | ||
deploymentName: '_site' | ||
percentage: 100 |
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,22 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
- name: Install | ||
run: npm install --legacy-peer-deps | ||
- name: Test | ||
run: npm run test:coverage | ||
if: ${{ always() }} | ||
# - name: report coverage | ||
# uses: coverallsapp/github-action@main | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} |
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,15 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx|json|yml|md|html|css)$' || true; }) | ||
|
||
if [ -z "$FILES" ]; then | ||
exit 0 | ||
fi | ||
|
||
TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx)$' || true; }) | ||
|
||
if [[ ! -z "$TS_FILES" ]];then | ||
echo "Running lints" | ||
npm run pre-commit:fix:code -- $TS_FILES | ||
fi |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "@dcl/auth-site", | ||
"version": "0.0.0", | ||
"description": "Auth website", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"decentraland", | ||
"profile", | ||
"site" | ||
], | ||
"author": "Decentraland", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/decentraland/auth.git" | ||
}, | ||
"homepage": "" | ||
} |
Oops, something went wrong.