Skip to content

Commit

Permalink
account migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Basty committed Feb 2, 2024
1 parent e6d80b6 commit dfa1c6f
Show file tree
Hide file tree
Showing 79 changed files with 5,668 additions and 129 deletions.
2 changes: 2 additions & 0 deletions .github/codeowners
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @xDarksome
* @xav
79 changes: 79 additions & 0 deletions .github/workflows/dispatch_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: ⚙️ Deploy
run-name: "Deploy: ${{ github.sha }} ➠ ${{ inputs.version }}${{ (!inputs.deploy-infra && !inputs.deploy-app) && ' 👀 deploy nothing' || ''}}${{ inputs.deploy-infra && ' ❱❱  infra' || '' }}${{ inputs.deploy-app && ' ❱❱  app' || '' }}"

on:
workflow_dispatch:
inputs:
deploy-infra:
description: "Deploy Infra"
default: true
required: true
type: boolean
deploy-app:
description: "Deploy App"
default: true
required: true
type: boolean
stage:
description: 'Target Environment'
type: choice
options:
- staging
- prod
default: staging
required: true
version:
description: "Release Version"
type: string
default: '-current-'

concurrency: deploy

permissions:
contents: write
checks: write
id-token: write
packages: write

jobs:
get_deployed_version:
name: Lookup Version
if: ${{ !inputs.deploy-app && inputs.version == '-current-' }}
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/release-get_deployed_version.yml@0.1.3
with:
task-name-stage: prod
task-name: ${{ vars.TASK_NAME }}
aws-region: ${{ vars.AWS_REGION }}
aws-role-arn: ${{vars.AWS_ROLE_PROD}}
run-group: ${{ vars.RUN_GROUP }}

select_version:
name: Select Version
needs: [ get_deployed_version ]
if: ${{ always() && !cancelled() && !failure() }}
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- name: Select target version
id: select_version
run: |
if [ "${{ inputs.deploy-app }}" != "true" ] && [ "${{ inputs.version }}" == "-current-" ]; then
echo "version=${{ needs.get_deployed_version.outputs.version }}" >> "$GITHUB_OUTPUT"
else
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
fi
outputs:
version: ${{ steps.select_version.outputs.version }}

cd:
name: CD
uses: ./.github/workflows/sub-cd.yml
needs: [ select_version ]
if: ${{ always() && !cancelled() && !failure() }}
secrets: inherit
with:
deploy-infra: ${{ inputs.deploy-infra }}
deploy-app: ${{ inputs.deploy-app }}
deploy-prod: ${{ inputs.stage == 'prod' }}
version: ${{ needs.select_version .outputs.version }}
52 changes: 52 additions & 0 deletions .github/workflows/dispatch_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ⚙️ Publish
run-name: "Publish: ${{ github.sha }}${{ inputs.deploy-to != 'none' && format(' ❱❱ {0}', inputs.deploy-to) || ''}}"

on:
workflow_dispatch:
inputs:
deploy-to:
description: "Deploy published image to"
type: choice
options:
- none
- staging
- prod
default: staging
required: true

concurrency: deploy

permissions:
contents: write
checks: write
id-token: write
packages: write

jobs:
ci:
name: CI
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.1.3
secrets: inherit
with:
check-infra: false
check-app: true

release:
name: Release
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@0.1.3
secrets: inherit
with:
infra-changed: false
app-changed: true

cd:
name: CD
needs: [ release ]
if: ${{ inputs.deploy-to == 'staging' || inputs.deploy-to == 'prod' }}
secrets: inherit
uses: ./.github/workflows/sub-cd.yml
with:
deploy-infra: false
deploy-app: true
deploy-prod: ${{ inputs.deploy-to == 'prod' }}
version: ${{ needs.release.outputs.version }}
57 changes: 57 additions & 0 deletions .github/workflows/dispatch_validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ⚙️ Validate
run-name: "Validate: ${{ github.sha }}${{ (!inputs.check-infra && !inputs.check-app) && '👀 validate nothing' || ''}}${{ inputs.check-infra && ' ✓  infra' || '' }}${{ inputs.check-app && ' ✓  app' || '' }}"
on:
workflow_dispatch:
inputs:
check-infra:
description: "Validate Infra"
default: true
required: true
type: boolean
check-app:
description: "Validate App"
default: true
required: true
type: boolean
check-staging:
description: "Validate Staging"
default: false
required: true
type: boolean
check-prod:
description: "Validate Prod"
default: false
required: true
type: boolean

permissions:
contents: read
checks: write
id-token: write

jobs:
ci:
name: CI
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.1.3
secrets: inherit
with:
check-infra: ${{ inputs.check-infra }}
check-app: ${{ inputs.check-app }}

validate-staging:
name: Validate - Staging
if: ${{ inputs.check-staging }}
uses: ./.github/workflows/sub-validate.yml
secrets: inherit
with:
stage: staging
stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com

validate-prod:
name: Validate - Prod
if: ${{ inputs.check-prod }}
uses: ./.github/workflows/sub-validate.yml
secrets: inherit
with:
stage: prod
stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com
47 changes: 47 additions & 0 deletions .github/workflows/event_intake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow moves issues to the Project board when they receive the "accepted" label
# When WalletConnect Org members create issues they are automatically "accepted".
# Otherwise, they need to manually receive that label during intake.
name: ⚡ Intake

on:
issues:
types: [ opened, labeled ]

jobs:
add-to-project:
name: Add issue to board
if: github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'accepted'
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- uses: actions/add-to-project@v0.1.0
with:
project-url: https://github.com/orgs/WalletConnect/projects/20
github-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
labeled: accepted
label-operator: OR

auto-promote:
name: auto-promote
if: github.event.action == 'opened'
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- name: Check Core Team membership
uses: tspascoal/get-user-teams-membership@v1
id: is-core-team
with:
username: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
team: "Core Team"
GITHUB_TOKEN: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
- name: Print result
env:
CREATOR: ${{ github.event_name != 'pull_request' && github.event.issue.user.login || github.event.sender.login }}
IS_TEAM_MEMBER: ${{ steps.is-core-team.outputs.isTeamMember }}
run: echo "$CREATOR (Core Team Member $IS_TEAM_MEMBER) created this issue/PR"
- name: Label issues
if: ${{ steps.is-core-team.outputs.isTeamMember == 'true' }}
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
add-labels: "accepted"
repo-token: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/event_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ⚡ Pull-Request
run-name: 'PR / ${{ github.event.pull_request.title }}'

on:
pull_request:
types:
- opened # A pull request was created.
- reopened # A closed pull request was reopened.
- edited # A pull request's title, body, or labels are edited.
- synchronize # A pull request's branch was synchronized with its base branch.
- unlocked # Conversation on a pull request was unlocked.

concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
id-token: write
issues: read
pull-requests: write

jobs:
check_pr:
name: Check PR
runs-on:
group: ${{ vars.RUN_GROUP }}
permissions:
statuses: write
steps:
- name: Check PR Title
uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

paths-filter:
name: Paths Filter
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- uses: actions/checkout@v3
- uses: WalletConnect/actions/github/paths-filter/@2.2.1
id: filter
outputs:
infra: ${{ steps.filter.outputs.infra }}
app: ${{ steps.filter.outputs.app }}

ci:
name: CI
needs: [ paths-filter ]
uses: WalletConnect/ci_workflows/.github/workflows/ci.yml@0.1.3
secrets: inherit
with:
check-app: ${{ needs.paths-filter.outputs.app == 'true' }}
check-infra: ${{ needs.paths-filter.outputs.infra == 'true' }}

merge_check:
name: Merge Check
needs: [ check_pr, ci ]
if: ${{ always() && !cancelled() && !failure() }}
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- run: echo "CI is successful"
64 changes: 64 additions & 0 deletions .github/workflows/event_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ⚡ Release
run-name: 'Release / ${{ github.event.head_commit.message }}'

on:
push:
branches:
- main
- master
paths-ignore:
- '.github/**'
- 'docs/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
- 'justfile'
- 'rustfmt.toml'
- '.editorconfig'
- '.pre-commit-config.yaml'
- '.terraformignore'
- '.env.example'

concurrency: deploy

permissions:
contents: write
id-token: write
packages: write
checks: write

jobs:
paths_filter:
name: Paths Filter
runs-on:
group: ${{ vars.RUN_GROUP }}
steps:
- uses: actions/checkout@v3
- uses: WalletConnect/actions/github/paths-filter/@2.2.1
id: filter
outputs:
infra: ${{ steps.filter.outputs.infra }}
app: ${{ steps.filter.outputs.app }}

release:
name: Release
needs: [ paths_filter ]
uses: WalletConnect/ci_workflows/.github/workflows/release.yml@0.1.3
secrets: inherit
with:
task-name: ${{ vars.TASK_NAME }}
infra-changed: ${{ needs.paths_filter.outputs.infra == 'true' }}
app-changed: ${{ needs.paths_filter.outputs.app == 'true' }}

cd:
name: CD
needs: [ paths_filter, release ]
secrets: inherit
uses: ./.github/workflows/sub-cd.yml
with:
deploy-infra: ${{ needs.paths_filter.outputs.infra == 'true' }}
deploy-app: ${{ needs.paths_filter.outputs.app == 'true' }}
deploy-prod: true
version: ${{ needs.release.outputs.version }}
Loading

0 comments on commit dfa1c6f

Please sign in to comment.