Skip to content

Commit b7ffdc8

Browse files
Remove GH actions
1 parent 0b50cc3 commit b7ffdc8

5 files changed

Lines changed: 261 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @splitio/sdk

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# JavaScript Browser SDK
2+
3+
## What did you accomplish?
4+
5+
## How do we test the changes introduced in this PR?
6+
7+
## Extra Notes

.github/workflows/ci-cd.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: ci-cd
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- development
7+
push:
8+
branches:
9+
- '*'
10+
11+
env:
12+
PUPPETEER_SKIP_DOWNLOAD: 'true'
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
id-token: write
21+
22+
jobs:
23+
build:
24+
name: Build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v6
32+
with:
33+
node-version: 'lts/*'
34+
cache: 'npm'
35+
36+
- name: npm ci
37+
run: npm ci
38+
39+
- name: Setup Chrome
40+
uses: browser-actions/setup-chrome@19ae4b339ee18925ab85cf12c1041150ea4a44c8 # v1
41+
with:
42+
chrome-version: '125'
43+
- name: Set CHROME_BIN
44+
run: echo "CHROME_BIN=$(which chrome)" >> $GITHUB_ENV
45+
46+
- name: npm test-ts-decls
47+
run: npm run test-ts-decls
48+
49+
- name: npm check
50+
run: npm run check
51+
52+
- name: npm test
53+
run: npm run test
54+
55+
- name: npm build
56+
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build
57+
58+
- name: Store assets
59+
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
60+
uses: actions/upload-artifact@v5
61+
with:
62+
name: assets
63+
path: umd/
64+
retention-days: 1
65+
66+
upload-stage:
67+
name: Upload assets
68+
runs-on: ubuntu-latest
69+
needs: build
70+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
71+
strategy:
72+
matrix:
73+
environment:
74+
- stage
75+
include:
76+
- environment: stage
77+
account_id: "079419646996"
78+
bucket: split-public-stage
79+
80+
steps:
81+
- name: Download assets
82+
uses: actions/download-artifact@v6
83+
with:
84+
name: assets
85+
path: umd
86+
87+
- name: Display structure of assets
88+
run: ls -R
89+
working-directory: umd
90+
91+
- name: Configure AWS credentials
92+
uses: aws-actions/configure-aws-credentials@v4
93+
with:
94+
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
95+
aws-region: us-east-1
96+
97+
- name: Upload to S3
98+
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
99+
env:
100+
BUCKET: ${{ matrix.bucket }}
101+
SOURCE_DIR: ./umd
102+
DEST_DIR: sdk
103+
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public
104+
105+
upload-prod:
106+
name: Upload assets
107+
runs-on: ubuntu-latest
108+
needs: build
109+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
110+
strategy:
111+
matrix:
112+
environment:
113+
- prod
114+
include:
115+
- environment: prod
116+
account_id: "825951051969"
117+
bucket: split-public
118+
119+
steps:
120+
- name: Download assets
121+
uses: actions/download-artifact@v6
122+
with:
123+
name: assets
124+
path: umd
125+
126+
- name: Display structure of assets
127+
run: ls -R
128+
working-directory: umd
129+
130+
- name: Configure AWS credentials
131+
uses: aws-actions/configure-aws-credentials@v4
132+
with:
133+
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
134+
aws-region: us-east-1
135+
136+
- name: Upload to S3
137+
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
138+
env:
139+
BUCKET: ${{ matrix.bucket }}
140+
SOURCE_DIR: ./umd
141+
DEST_DIR: sdk
142+
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public

.github/workflows/sonar-scan.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: sonar-scan
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- development
7+
push:
8+
branches:
9+
- main
10+
- development
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version: 'lts/*'
26+
cache: 'npm'
27+
28+
- name: npm CI
29+
run: npm ci
30+
31+
- name: npm Check
32+
run: npm run check
33+
34+
- name: npm Build
35+
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build
36+
37+
- name: SonarQube Scan (Push)
38+
if: github.event_name == 'push'
39+
uses: SonarSource/sonarqube-scan-action@v6
40+
env:
41+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
42+
with:
43+
projectBaseDir: .
44+
args: >
45+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
46+
-Dsonar.projectName=${{ github.event.repository.name }}
47+
-Dsonar.projectKey=${{ github.event.repository.name }}
48+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
49+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
50+
51+
- name: SonarQube Scan (Pull Request)
52+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
53+
uses: SonarSource/sonarqube-scan-action@v6
54+
env:
55+
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
56+
with:
57+
projectBaseDir: .
58+
args: >
59+
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
60+
-Dsonar.projectName=${{ github.event.repository.name }}
61+
-Dsonar.projectKey=${{ github.event.repository.name }}
62+
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
63+
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
64+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
65+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
66+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update Notice Year
2+
3+
on:
4+
schedule:
5+
- cron: "0 3 1 1 *" # 03:00 AM on January 1
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set Current year
21+
run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV"
22+
23+
- name: Set Previous Year
24+
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
25+
26+
- name: Update NOTICE
27+
uses: jacobtomlinson/gha-find-replace@v3
28+
with:
29+
find: ${{ env.PREVIOUS }}
30+
replace: ${{ env.CURRENT }}
31+
include: "NOTICE"
32+
regex: false
33+
34+
- name: Commit files
35+
run: |
36+
git config user.name 'github-actions[bot]'
37+
git config user.email 'github-actions[bot]@users.noreply.github.com'
38+
git commit -m "Updated Notice Year" -a
39+
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@v5
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
title: Update Notice Year
45+
branch: update-notice

0 commit comments

Comments
 (0)