diff --git a/.circleci/announcePublish.sh b/.circleci/announcePublish.sh new file mode 100644 index 0000000..6703398 --- /dev/null +++ b/.circleci/announcePublish.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -euo pipefail + +applicationName=$1 +package=$2 + +payload=$( +cat <> $BASH_ENV + echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> $BASH_ENV + source $BASH_ENV + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/free-bundler/.npmrc + - restore_cache: + key: dependency-cache-{{ checksum "bun.lockb" }} + - run: + name: Install dependencies + command: bun install + - save_cache: + key: dependency-cache-{{ checksum "bun.lockb" }} + paths: + - ./node_modules + - ~/.bun + - run: + name: Dry run build + command: bun run build + # - slack/status: + # failure_message: "Triggered by: *${CIRCLE_USERNAME}* \n\n Ooops! The *$CIRCLE_JOB* job has failed! :circleci-fail:" + # webhook: "${SLACK_WEBHOOK_URL}" + + publish-npm-package: + working_directory: ~/free-bundler + docker: + - image: cimg/node:18.16.1 + auth: + username: $DOCKERHUB_USER + password: $DOCKERHUB_PASSWORD + steps: + - checkout + - run: + name: Install Bun + command: | + curl -fsSL https://bun.sh/install | bash + echo 'export BUN_INSTALL="$HOME/.bun"' >> $BASH_ENV + echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> $BASH_ENV + source $BASH_ENV + - restore_cache: + key: dependency-cache-{{ checksum "bun.lockb" }} + - run: + name: Authenticate with registry + command: echo "//registry.npmjs.org/:_authToken=$ETHERSPOT_NPM_TOKEN" > ~/free-bundler/.npmrc + - run: + name: Install dependencies + command: bun install + - run: + name: Build Etherpot Free Bundler + command: bun run build + - run: + name: Publish package to npm + command: | + cd ~/free-bundler + bun publish --access public + - run: + name: Announce Publish + command: | + chmod +x .circleci/announcePublish.sh + .circleci/announcePublish.sh "Etherspot Free Bundler" "$(node -e "console.log(require('./package.json').version)")" + publish-github-release: + docker: + - image: ardd97/ghr + steps: + - checkout + - run: + name: "Publish Release on GitHub" + command: | + PACKAGE_VERSION="$(jq .version package.json -r)" + echo $PACKAGE_VERSION + ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" "$PACKAGE_VERSION" + +workflows: + version: 2.1 + install_and_publish: + jobs: + - install: + context: general-vars + - publish-npm-package: + context: general-vars + filters: + branches: + only: + - master + - publish-github-release: + context: general-vars + requires: + - publish-npm-package + filters: + branches: + only: + - master diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..1b29621 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,57 @@ +name: 🐛 Bug report +description: Create a bug report to help us improve +title: "[BUG] " +body: + - type: textarea + id: describe + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is and steps to reproduce it. + placeholder: This is what I'm seeing. + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + placeholder: This is what should happen. + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: List the steps to reproduce the behavior + placeholder: | + 1. Check logs and errors + validations: + required: false + - type: textarea + id: attachments + attributes: + label: Additional context + description: If applicable, add screenshots, links or other context about the issue + placeholder: | + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false + - type: dropdown + attributes: + label: Operating system + description: What type of operating system are you running on? + multiple: false + options: + - Linux + - macOS + - Windows + validations: + required: true + - type: input + id: version + attributes: + label: Prime SDK version or commit hash + description: Which version or commit hash of Skandha are you running? + placeholder: v0.0.1 or 214ee64 + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e0071ee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Documentation + url: https://etherspot.fyi/introduction + about: For more detailed guide follow our docs + - name: Join our Discord community + url: https://discord.etherspot.io + about: Participate in our thriving community of contributors, users, and supporters. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9d74902 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: "\U0001F680 Feature request" +about: Suggest an idea/feature for Etherspot Prime SDK +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..08e8500 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,21 @@ + +## Description + +- + +## Types of changes +What types of changes does your code introduce? + + +- [ ] Bugfix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation Update +- [ ] Code style update (formatting, renaming) +- [ ] Refactoring (no functional changes, no api changes) +- [ ] Build related changes +- [ ] Other (please describe): + +## Further comments (optional) + +- diff --git a/.github/workflows/check-package-version.yml b/.github/workflows/check-package-version.yml new file mode 100644 index 0000000..2070a99 --- /dev/null +++ b/.github/workflows/check-package-version.yml @@ -0,0 +1,44 @@ +name: npm package version bump and changelog check + +on: + pull_request: + branches: + - master +jobs: + start: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check if package version has been updated + id: check + uses: EndBug/version-check@v2.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + file-name: ./package.json + - name: Log when package version changed + if: steps.check.outputs.changed == 'true' + run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"' + - name: Log when package version unchanged + if: steps.check.outputs.changed == 'false' + uses: mshick/add-pr-comment@v2 + with: + message: | + **Yooo! You forgot to bump the version in package.json!** + allow-repeats: true + - name: Exit if package version is not changed + if: steps.check.outputs.changed == 'false' + run: echo "No version change :/ Please update version in package.json!" && exit 1 + - name: Check if CHANGELOG.md is updated + id: changelog-status + run: | + git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} + changed_files=$(git diff --name-only ${{ github.base_ref }} ${{ github.sha }} | grep CHANGELOG.md) + if [ -n "$changed_files" ]; then + echo "CHANGELOG.md has been changed." + echo "$changed_files" + else + echo "CHANGELOG.md has not been changed." && exit 1 + fi