Skip to content

Commit

Permalink
switch to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardwolff authored Jan 6, 2025
1 parent 3a3d995 commit 7eda4c5
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 102 deletions.
39 changes: 0 additions & 39 deletions .circleci/config.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches: [ master ]

permissions:
id-token: write
contents: read

env:
AWS_ROLE: ${{ secrets.awsIAMS3UploadRole }}

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '10'

- name: Install dependencies
run: yarn

- name: Run Build
run: yarn run build

- name: Configure AWS Credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 on 2025-01-06
with:
role-to-assume: ${{ env.AWS_ROLE }}
role-session-name: github-action-account-link-extension-publish
aws-region: us-west-1

- name: Run Deploy
run: sh tools/cdn.sh
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on:
push:
branches-ignore: [ master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '10'

- name: Install dependencies
run: yarn

- name: Run Tests
run: yarn run test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.9
10
56 changes: 0 additions & 56 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth0-account-link-extension",
"version": "2.6.5",
"version": "2.6.6",
"description": "Auth0 Account Link Extension",
"main": "index.js",
"engines": {
Expand Down
10 changes: 5 additions & 5 deletions tools/cdn.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
CURRENT_VERSION=$(node tools/attribute.js version)
EXTENSION_NAME="auth0-account-link-extension"
EXTENSION_NAME="auth0-account-link"

CDN_EXISTS=$(aws s3 ls s3://assets.us.auth0.com/css/$EXTENSION_NAME/$CURRENT_VERSION/ | grep "link.min.css")
ADMIN_CDN_EXISTS=$(aws s3 ls s3://assets.us.auth0.com/css/$EXTENSION_NAME/$CURRENT_VERSION/ | grep "admin.min.css")
CDN_EXISTS=$(aws s3 ls s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/assets/ | grep "link.$CURRENT_VERSION.min.css")
ADMIN_CDN_EXISTS=$(aws s3 ls s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/assets/ | grep "admin.$CURRENT_VERSION.min.css")

if [ ! -z "$CDN_EXISTS" ]; then
echo "There is already a version $CURRENT_VERSION in the cdn. Skipping cdn publish…"
else
aws s3 cp public/css/link.min.css s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/$CURRENT_VERSION/link.min.css --region us-west-1 --quiet --cache-control "max-age=86400" --acl public-read
aws s3 cp dist/assets/link.$CURRENT_VERSION.min.css s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/assets/link.$CURRENT_VERSION.min.css --region us-west-1 --cache-control "max-age=86400" --acl public-read
echo "$CURRENT_VERSION uploaded to the cdn"
fi

if [ ! -z "$ADMIN_CDN_EXISTS" ]; then
echo "There is already a version $CURRENT_VERSION in the cdn. Skipping cdn publish…"
else
aws s3 cp public/css/admin.min.css s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/$CURRENT_VERSION/admin.min.css --region us-west-1 --quiet --cache-control "max-age=86400" --acl public-read
aws s3 cp dist/assets/admin.$CURRENT_VERSION.min.css s3://assets.us.auth0.com/extensions/$EXTENSION_NAME/assets/admin.$CURRENT_VERSION.min.css --region us-west-1 --cache-control "max-age=86400" --acl public-read
echo "$CURRENT_VERSION uploaded to the cdn"
fi

0 comments on commit 7eda4c5

Please sign in to comment.