diff --git a/.github/ISSUE_TEMPLATE/0_bug.md b/.github/ISSUE_TEMPLATE/0_bug.md new file mode 100644 index 000000000000..486894e82d45 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/0_bug.md @@ -0,0 +1,33 @@ +--- +name: Report a Bug +about: Help us reproduce a bug you've found so that we can fix it +title: '' +labels: ['bug'] +assignees: '' +--- + + + +## Overview + + + +## Steps to reproduce + + + +## Description of bug + + diff --git a/.github/ISSUE_TEMPLATE/1_feature.md b/.github/ISSUE_TEMPLATE/1_feature.md new file mode 100644 index 000000000000..570e146b0416 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_feature.md @@ -0,0 +1,31 @@ +--- +name: Suggest a Feature +about: Propose an idea for how to make this library better. +title: '' +labels: ['enhancement'] +assignees: '' +--- + + + +## Motivation + + + +## Example use case + + + +## Details + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..d061b0bc53df --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - about: 'Have a question about using this software, or about Solana in general? Post it on the Solana Stack Exchange.' + name: Ask a Question + url: 'https://solana.stackexchange.com/questions/ask' + - about: 'Start or join a discussion on the Solana Tech Discord.' + name: Start a Discussion + url: 'https://solana.com/discord' diff --git a/.github/workflows/PULL_REQUEST_TEMPLATE.md b/.github/workflows/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..e798ebfba222 --- /dev/null +++ b/.github/workflows/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +#### Problem + +#### Summary of Changes + +Fixes # diff --git a/.github/workflows/actions/compile-gh-pages/action.yml b/.github/workflows/actions/compile-gh-pages/action.yml index d2394bc90935..984f5ccf60fa 100644 --- a/.github/workflows/actions/compile-gh-pages/action.yml +++ b/.github/workflows/actions/compile-gh-pages/action.yml @@ -9,6 +9,12 @@ runs: run: pnpm compile:docs - name: Assemble Deploy Directory + shell: bash + run: | + mkdir -p .ghpages-deploy + mv ./doc/* .ghpages-deploy + + - name: Assemble Deploy Versioned Subdirectory shell: bash run: | mkdir -p .ghpages-deploy/v1.x diff --git a/.github/workflows/autolock-inactive-threads.yml b/.github/workflows/autolock-inactive-threads.yml new file mode 100644 index 000000000000..d25a7acfeda5 --- /dev/null +++ b/.github/workflows/autolock-inactive-threads.yml @@ -0,0 +1,32 @@ +name: 'Lock inactive threads' + +on: + # Chosen to be just before London wakes up and way past San Francisco's bedtime. + schedule: + - cron: '0 8 * * 1-5' # This is in UTC. + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v4 + with: + github-token: ${{ github.token }} + issue-inactive-days: '7' + issue-lock-reason: 'resolved' + issue-comment: > + Because there has been no activity on this issue for 7 days since it was closed, it has + been automatically locked. Please open a new issue if it requires a follow up. + pr-inactive-days: '14' + pr-lock-reason: 'resolved' + pr-comment: > + Because there has been no activity on this PR for 14 days since it was merged, it has + been automatically locked. Please open a new issue if it requires a follow up. diff --git a/.github/workflows/label-actions.yml b/.github/workflows/label-actions.yml new file mode 100644 index 000000000000..45b36ac48543 --- /dev/null +++ b/.github/workflows/label-actions.yml @@ -0,0 +1,15 @@ +name: 'Issue Label Actions' + +on: + issues: + types: [labeled, unlabeled] + +permissions: + contents: read + issues: write + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/label-actions@v2 diff --git a/.github/workflows/manage-stale-threads.yml b/.github/workflows/manage-stale-threads.yml new file mode 100644 index 000000000000..ff802edc9d54 --- /dev/null +++ b/.github/workflows/manage-stale-threads.yml @@ -0,0 +1,39 @@ +name: 'Manage stale issues and PRs' +on: + # Chosen to be just before London wakes up and way past San Francisco's bedtime. + schedule: + - cron: '0 8 * * 1-5' # This is in UTC. + # Do a dry-run (debug-only: true) whenever this workflow itself is changed. + pull_request: + paths: + - .github/workflows/manage-stale-threads.yml + types: + - opened + - synchronize + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + ascending: true # Spend API operations budget on older, more-likely-to-get-closed issues first + close-issue-message: '' # Leave no comment when closing + close-pr-message: '' # Leave no comment when closing + days-before-issue-stale: 365 + days-before-pr-stale: 14 + days-before-close: 7 + debug-only: ${{ github.event_name == 'pull_request' }} # Dry-run when true. + exempt-all-milestones: true # Milestones can sometimes last a month, so exempt issues attached to a milestone. + exempt-issue-labels: blocked,do-not-close,feature-gate,security + exempt-pr-labels: blocked,do-not-close,feature-gate,security + # No actual changes get made in debug-only mode, so we can raise the operations ceiling. + operations-per-run: ${{ github.event_name == 'pull_request' && 1000 || 900}} + stale-issue-label: stale + stale-issue-message: '' # Leave no comment when marking as stale + stale-pr-label: stale + stale-pr-message: '' # Leave no comment when marking as stale diff --git a/.github/workflows/preview-gh-pages.yml b/.github/workflows/preview-gh-pages.yml new file mode 100644 index 000000000000..5958d382739b --- /dev/null +++ b/.github/workflows/preview-gh-pages.yml @@ -0,0 +1,84 @@ +name: Preview GitHub Pages + +on: + pull_request: + types: [synchronize, opened, reopened] + +env: + # Among other things, opts out of Turborepo telemetry + # See https://consoledonottrack.com/ + DO_NOT_TRACK: '1' + # Some tasks slow down considerably on GitHub Actions runners when concurrency is high + TURBO_CONCURRENCY: 1 + # Enables Turborepo Remote Caching. + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + +jobs: + compile-gh-pages: + runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: maintenance/v1.x + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Compile and Upload Artifacts + uses: ./.github/workflows/actions/compile-gh-pages + + preview: + runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + needs: [compile-gh-pages] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Download Deploy Directory from Artifact Cache + uses: actions/download-artifact@v4 + with: + path: .ghpages-deploy + pattern: ghpages-deploy-artifacts* + merge-multiple: true + + - name: Deploy to Preview Github Pages + uses: peaceiris/actions-gh-pages@v4 + with: + destination_dir: ${{ format('{0}/', github.event.pull_request.number) }} + external_repository: solana-labs/solana-web3.js-pr-preview + personal_token: ${{ secrets.PR_PREVIEW_REPO_CONTENTS_TOKEN }} + publish_dir: .ghpages-deploy + + - name: Find Existing Preview Link Comment + uses: peter-evans/find-comment@v3 + id: find-comment + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: + + - name: Create Preview Link Comment + uses: actions/github-script@v7 + if: steps.find-comment.outputs.comment-id == '' + with: + script: > + const prNumber = context.issue.number; + github.rest.issues.createComment({ + issue_number: prNumber, + owner: context.repo.owner, + repo: context.repo.repo, + body: [ + '', + 'A preview of the GitHub Pages site based on this PR is now available here:', + '', + `solana-labs.github.io/solana-web3.js-pr-preview/${prNumber}/`, + ].join('\n'), + }); diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml new file mode 100644 index 000000000000..d1a664715f3d --- /dev/null +++ b/.github/workflows/publish-gh-pages.yml @@ -0,0 +1,58 @@ +name: Publish GitHub Pages + +on: + workflow_dispatch: + branches: + - maintenance/* + push: + branches: + - maintenance/* + +env: + # Among other things, opts out of Turborepo telemetry + # See https://consoledonottrack.com/ + DO_NOT_TRACK: '1' + # Some tasks slow down considerably on GitHub Actions runners when concurrency is high + TURBO_CONCURRENCY: 1 + # Enables Turborepo Remote Caching. + TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} + +jobs: + compile-gh-pages: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: maintenance/v1.x + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Compile and Upload Artifacts + uses: ./.github/workflows/actions/compile-gh-pages + + publish: + runs-on: ubuntu-latest + needs: [compile-gh-pages] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Dependencies + uses: ./.github/workflows/actions/install-dependencies + + - name: Download Deploy Directory from Artifact Cache + uses: actions/download-artifact@v4 + with: + path: .ghpages-deploy + pattern: ghpages-deploy-artifacts* + merge-multiple: true + + - name: Deploy to Github Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: .ghpages-deploy