diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2021ce705..f0528daaf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,2 @@ -* @stoplightio/prism-engineers +# Global rule: +* @Bandwidth/band-cx-accounts-and-identity @Bandwidth/band-cx-accounts-and-identity-github-repo-admin diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 66938b991..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom: -- https://plant.treeware.earth/stoplightio/prism diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index fb9eb06b0..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: npm - directory: '/' - schedule: - interval: 'daily' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index c09b1e186..000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,28 +0,0 @@ -Addresses #[ISSUE_NUMBER] - -**Summary** - -Replace this with something that explains what this PR is for and why it matters. - -**Checklist** - -- The basics - - [ ] I tested these changes manually in my local or dev environment -- Tests - - [ ] Added or updated - - [ ] N/A -- Event Tracking - - [ ] I added event tracking and followed the event tracking guidelines - - [ ] N/A -- Error Reporting - - [ ] I reported errors and followed the error reporting guidelines - - [ ] N/A - -**Screenshots** - -If applicable, add screenshots or gifs to help demonstrate the changes. If not applicable, remove this screenshots -section before creating the PR. - -**Additional context** - -Add any other context about the pull request here. Remove this section if there is no additional context. diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml deleted file mode 100644 index 47f710072..000000000 --- a/.github/workflows/auto-approve.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Auto Approve DependaBot PRs - -on: - pull_request: - branches: - - master - -permissions: - pull-requests: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1.1.1 - with: - github-token: '${{ secrets.GITHUB_TOKEN }}' - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml deleted file mode 100644 index 98d59e3f2..000000000 --- a/.github/workflows/auto-merge-dependabot.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Auto Merge Dependabot PRs -on: - pull_request: - branches: - - master - -permissions: - contents: write - pull-requests: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1.1.1 - with: - github-token: '${{ secrets.GITHUB_TOKEN }}' - - name: Enable auto-merge for Dependabot PRs - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18bbebdff..b03ea33a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,12 @@ on: push: branches: - master + tags: + - 'v*' + pull_request: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} container: image: node:18.20 steps: @@ -54,7 +57,8 @@ jobs: - name: Run Harness run: yarn test.harness harness-docker: - runs-on: ubuntu-latest + if: github.event_name == 'push' + runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} container: image: node:18.20 env: @@ -80,46 +84,58 @@ jobs: run: yarn build.binary - name: Run Harness run: yarn test.harness - publish: - if: (github.ref == 'refs/tags/"v[0-9].[0-9]+.[0-9]+"') && (github.ref != 'refs/heads/master') - runs-on: ubuntu-latest - container: - image: node:18.20 + publish-docker-dev: + if: github.event_name == 'push' || github.event_name == 'pull_request' + runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} needs: - build - - harness-macos - - harness-docker steps: - uses: actions/checkout@v4.1.0 - - name: Set git identity - run: git config user.email "circle@circleci.com" && git config user.name "circleci" - - name: Install Dependencies - run: yarn --frozen-lockfile - - name: Build all code to JavaScript - run: yarn build - - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc - - name: Publish - run: yarn lerna publish from-git --create-release=github --yes - - name: Create CLI binaries - run: npx pkg --out-path ./cli-binaries ./packages/cli/ - - uses: actions/upload-artifact@v4.1.0 + - name: Get Vault Tokens + uses: Bandwidth/vault-provider-action@v1 with: - path: "./cli-binaries" - - uses: actions/upload-artifact@v4.1.0 + artifactory-access-token-type: dev-writers + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker registry + uses: docker/login-action@v3 with: - path: ".//cli-binaries" - upload_artifacts: - if: (github.ref == 'refs/tags/"v[0-9].[0-9]+.[0-9]+"') && (github.ref != 'refs/heads/master') - runs-on: ubuntu-latest - container: - image: golang:1.23 - needs: - - publish - steps: - - uses: actions/download-artifact@v4.1.0 + registry: ${{ env.DEV_DOCKER_REGISTRY }} + username: ${{ env.ARTIFACTORY_ACCESS_TOKEN_USERNAME }} + password: ${{ env.ARTIFACTORY_ACCESS_TOKEN }} + - name: Get short SHA + id: sha + run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build and push Docker image + uses: docker/build-push-action@v5 with: - path: "/tmp/" - - name: Download GitHub Release Utility - run: go install github.com/tcnksm/ghr@latest - - name: Publish Release artifacts on GitHub - run: ghr -t ${{github.token}} -u ${{ github.actor }} -r ${{ github.repository }} -c ${{ github.sha }} ${{ github.ref }} /tmp/cli-binaries + context: . + push: true + tags: ${{ env.DEV_DOCKER_REGISTRY }}/prism:${{ steps.sha.outputs.short }} + cache-from: type=gha + cache-to: type=gha,mode=max + setup: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ${{ fromJSON(vars.BW_RUNNER_GLORG_EKS_PROD_UBUNTU_2404_AMD64_S) }} + outputs: + sha: ${{ steps.sha.outputs.short }} + version: ${{ steps.version.outputs.tag }} + steps: + - uses: actions/checkout@v4.1.0 + - name: Get short SHA + id: sha + run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Extract version from tag + id: version + run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + promote-docker-image-in-artifactory: + name: Promote Docker Images in Artifactory + if: startsWith(github.ref, 'refs/tags/v') + needs: [ setup ] + uses: Bandwidth/artifact-promotion-workflow/.github/workflows/af-to-af-promotion.yml@v3 + with: + artifactory-origin-repository: docker-local + artifactory-origin-docker-image-path-csv: prism + artifactory-origin-docker-image-tag: ${{ needs.setup.outputs.sha }} + artifactory-destination-repository: docker-local-prod + artifactory-destination-docker-image-tag: ${{ needs.setup.outputs.version }} diff --git a/.github/workflows/jira-issue-label-added.yaml b/.github/workflows/jira-issue-label-added.yaml deleted file mode 100644 index c3f8cd7be..000000000 --- a/.github/workflows/jira-issue-label-added.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Jira Issue Label Added - -on: - issues: - types: - - labeled - -jobs: - call-workflow: - uses: stoplightio/.github/.github/workflows/jira-issue-label-added.yaml@master - with: - team-name: ${{ contains(github.event.pull_request.labels.*.name, 'team/bad-news-bears') && 'Bad News Bears' || contains(github.event.pull_request.labels.*.name, 'team/maintenance') && 'Maintenance' || '' }} - secrets: inherit diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml deleted file mode 100644 index dd6f03ac7..000000000 --- a/.github/workflows/markdown-links.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Check Markdown Links - -on: - pull_request: - branches: - - master - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - fetch-depth: 1 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml deleted file mode 100644 index 7d32b890d..000000000 --- a/.github/workflows/pr-title.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'PR title uses semantic release format' - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - -permissions: - pull-requests: read - -jobs: - main: - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 350825cbd..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release -on: - push: - branches: - - master - -permissions: - contents: write - pull-requests: write - -jobs: - # Create release PR - release-please: - name: Release Please - runs-on: ubuntu-latest - if: github.repository == 'stoplightio/prism' - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: google-github-actions/release-please-action@v4 - id: release - with: - token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }} - target-branch: master