Skip to content

Commit

Permalink
merge develop into feat/oidc
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Jul 25, 2024
2 parents a6b380f + 9378a1d commit 7440af2
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 33 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,11 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: 'eu-central-1'
- run: npx nx run-many --target=build --parallel=3 --exclude=acq,core,discord,discord-bot-ui,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --skip-nx-cache
- run: npx nx run-many --target=build-server --parallel=3 --exclude=acq,core,discord,discord-bot-ui,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --skip-nx-cache
- run: npx nx build siwt.xyz --skip-nx-cache
- run: npx nx build-server siwt.xyz --skip-nx-cache

- name: Setup staging env file
if: github.ref == 'refs/heads/develop'
env:
CERTIFICATE_ARN: ${{ secrets.STAGING_SIWT_XYZ_SSL_CERTIFICATE_ARN }}
ENV: staging
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_SIWT_XYZ_DISTRIBUTION_ID }}
run: |
touch .env
echo SSL_CERTIFICATE_ARN=$CERTIFICATE_ARN >> .env
echo ENV=$ENV >> .env
cat .env
- name: Setup production env file
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/develop'
env:
CERTIFICATE_ARN: ${{ secrets.SIWT_XYZ_SSL_CERTIFICATE_ARN }}
ENV: production
Expand All @@ -81,14 +70,9 @@ jobs:
echo ENV=$ENV >> .env
cat .env
- name: Deploy
run: npx nx run-many --target=deploy --exclude=acq,core,discord,discord-bot-ui,discord-bot-ui-e2e,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --production --skip-nx-cache
- name: Invalidate Staging Distribution
run: npx nx deploy siwt.xyz --production --skip-nx-cache
- name: Invalidate Distribution
if: github.ref == 'refs/heads/develop'
env:
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_SIWT_XYZ_DISTRIBUTION_ID }}
run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths '/*'
- name: Invalidate Production Distribution
if: github.ref == 'refs/heads/main'
env:
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.SIWT_XYZ_DISTRIBUTION_ID }}
run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths '/*'
1 change: 1 addition & 0 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
build-and-release:
runs-on: ubuntu-latest
environment: Packages
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
Expand Down
2 changes: 1 addition & 1 deletion packages/acq/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siwt/acq",
"version": "0.0.6",
"version": "0.0.7",
"dependencies": {
"tslib": "^2.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siwt/core",
"version": "0.0.6",
"version": "0.0.7",
"dependencies": {
"tslib": "^2.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siwt/react",
"version": "0.0.6",
"version": "0.0.7",
"dependencies": {},
"main": "./index.js",
"module": "./index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siwt/sdk",
"version": "0.0.6",
"version": "0.0.7",
"dependencies": {
"tslib": "^2.3.0"
},
Expand Down
17 changes: 10 additions & 7 deletions packages/siwt.xyz/components/Try/Try.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const Try = () => {
const [isAllowlistInputValid, setIsAllowlistInputValid] = useState<boolean>(true)
const [selectedPolicies, setSelectedPolicies] = useState<string[]>([])
const [customPolicies, setCustomPolicies] = useState<string>('')
const [isCustomPoliciesValid, setIsCustomPoliciesValid] = useState<boolean>(true)
const [areCustomPoliciesValid, setAreCustomPoliciesValid] = useState<boolean>(true)
const [activeAccount, setActiveAccount] = useState<AccountInfo>({} as AccountInfo)
const [message, setMessage] = useState<string>('')
const [signature, setSignature] = useState<string>('')
Expand Down Expand Up @@ -197,9 +197,12 @@ export const Try = () => {

const onChangeCustomPolicies = (event: ChangeEvent<HTMLInputElement>) => {
setCustomPolicies(event.currentTarget.value)
test(/^([A-Za-z0-9]+, )*[A-Za-z0-9]+$/, event.currentTarget.value) || event.currentTarget.value === ''
? setIsCustomPoliciesValid(true)
: setIsCustomPoliciesValid(false)
test(
/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/,
event.currentTarget.value,
) || event.currentTarget.value === ''
? setAreCustomPoliciesValid(true)
: setAreCustomPoliciesValid(false)
}

const onChangeSelectedPolicies = (id: string) => {
Expand Down Expand Up @@ -407,7 +410,7 @@ export const Try = () => {
<CheckboxSet
id="policies"
label="Policies"
options={['Terms and Conditions', 'Privacy Policy']}
options={['https://siwt.xyz/terms-conditions', 'https://siwt.xyz/privacy-policy']}
onChange={onChangeSelectedPolicies}
checked={selectedPolicies}
/>
Expand All @@ -417,8 +420,8 @@ export const Try = () => {
id="other-policies"
value={customPolicies}
onChange={onChangeCustomPolicies}
explainer="Comma separated list of other policies your dApp may have. For example: 'Cookie policy, Refund policy'"
hasValidInput={isCustomPoliciesValid}
explainer="Comma separated list of urls to other policies your dApp may have."
hasValidInput={areCustomPoliciesValid}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siwt/smart-contracts",
"version": "0.0.6",
"version": "0.0.7",
"type": "commonjs",
"scripts": {
"tzgen": "tzgen",
Expand Down

0 comments on commit 7440af2

Please sign in to comment.