Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .circleci/announcePublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail

applicationName=$1
package=$2

payload=$(
cat <<EOM
{
"attachments": [
{
"fallback": "A new version of $applicationName is available for use. :circleci-pass:",
"color": "#33CC66",
"pretext": "A new version of $applicationName is available for use. :circleci-pass:",
"title": "$CIRCLE_PROJECT_REPONAME",
"title_link": "https://github.com/etherspot/free-bundler/releases/tag/$package",
"text": "Version: @etherspot/free-bundler@$package",
"ts": $(date '+%s')
}
]
}
EOM
)

curl -X POST --data-urlencode payload="$payload" "$SLACK_WEBHOOK_URL"
curl -X POST --data-urlencode payload="$payload" "$SLACK_WEBHOOK_FRONTEND"
114 changes: 114 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
version: 2.1
parameters:
run_e2e_tests:
type: boolean
default: true
orbs:
slack: circleci/slack@3.4.2

jobs:
install:
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
- 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
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in details -->
-

## Types of changes
What types of changes does your code introduce?
<!-- _Put an `x` in the boxes that apply_ -->

- [ ] 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)
<!--- Additional comments, don't hesitate :) -->
-
44 changes: 44 additions & 0 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
@@ -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
Loading