Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Jan 22, 2023
0 parents commit 5958e28
Show file tree
Hide file tree
Showing 138 changed files with 30,229 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @metaplex-foundation/protocol
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bug report
title: "[Bug]: "
description: Report incorrect or unexpected behavior
labels: [bug]
body:
- type: dropdown
id: package-type
attributes:
label: Which Type of Package is this bug report for?
options:
- Rust Contract
- JS SDK
validations:
required: true
- type: textarea
id: description
attributes:
label: Issue description
description: |
Describe the issue in as much detail as possible.
If this is for a JS SDK, please inclide your package json and any other build systems or package manager information.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
placeholder: |
Steps to reproduce with:
1. do thing
2. observe behavior
3. see error logs below
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
- type: dropdown
id: priority
attributes:
label: Priority this issue should have
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
options:
- Low (slightly annoying)
- Medium (should be fixed soon)
- High (immediate attention needed)
validations:
required: true
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Feature request
description: Request a new feature
title: "[Feature]: "
labels: [enhancement]
body:
- type: textarea
id: description
attributes:
label: Feature
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
placeholder: I'm always frustrated when..., A good addition would be...
validations:
required: true
- type: dropdown
id: standard-change
attributes:
label: Standard Change?
options:
- "No"
- "Yes"
description: Does this feature change the Metaplex token standard in a fundamental way?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Ideal solution or implementation
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternative solutions or implementations
description: A clear and concise description of any alternative solutions or features you have considered.
- type: textarea
id: additional-context
attributes:
label: Other context
description: Any other context, screenshots, or file uploads that help us understand your feature request.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Note
It's much easier for us to read and review a PR that is small, linted, and contains only one material enhancement. If your PR is very large and encompasing many features consider breaking it up in to a few PRs so we can digest the information in each pr with more accuracy.

### Description
Describe the purpose of and changes within this Pull Request.

### References
List links to any related tasks (GitHub Issues, Pull Requests, 3rd part task managers)

### Testing
How was this tested? If manually tested, list all steps necessary for the reviewer to confirm.
11 changes: 11 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Supported Versions

The following versions are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 0.x | :white_check_mark: |

## Reporting Security Issues

To report a security issue, please follow the guidance on our [security policy](https://docs.metaplex.com/security-policy) page.
16 changes: 16 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Implicit dependencies
# - actions/checkout@v3
# - ./.github/actions/install-linux-build-deps
# - ./.github/actions/install-solana
# - ./.github/actions/install-rust

name: Build Candy Guard
runs:
using: 'composite'
steps:
- name: build-candy-guard
working-directory: ./
run: |
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ./target/deploy/
shell: bash
22 changes: 22 additions & 0 deletions .github/actions/install-anchor/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# if referencing from a workflow, ANCHOR_VERSION environment variable must be defined
name: Setup Anchor CLI
description: 'Setup Anchor CLI'

runs:
using: 'composite'
steps:
- uses: actions/cache@v2
name: Cache Anchor CLI
id: cache-anchor-cli
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: anchor-cli-${{ runner.os }}-v0000-${{ env.ANCHOR_VERSION }}
- run:
cargo install --git https://github.com/project-serum/anchor --tag "v$ANCHOR_VERSION" anchor-cli --locked
shell: bash
if: steps.cache-anchor-cli.outputs.cache-hit != 'true'
49 changes: 49 additions & 0 deletions .github/actions/install-common-build-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Install common build deps

inputs:
linux:
description: Install or restore Linux dependencies from cache
required: false
default: true
rust:
description: Install or restore Rust from cache
required: false
default: true
rust-version:
description: Version for Rust, default to stable
required: false
default: 'stable'
solana:
description: Install or restore Solana from cache
required: false
default: true
anchor:
description: Install or restore Anchor CLI from cache
required: false
default: true
shank:
description: Install or restore Shank CLI from cache
required: false
default: true

runs:
using: composite
steps:
- uses: ./.github/actions/install-linux-build-deps
if: inputs.linux == 'true'

- uses: ./.github/actions/install-rust
if: inputs.rust == 'true'
with:
toolchain: ${{ inputs.rust-version }}

- uses: ./.github/actions/install-solana
if: inputs.solana == 'true'
with:
solana_version: ${{ env.SOLANA_VERSION }}

- uses: ./.github/actions/install-anchor
if: inputs.anchor == 'true'

- uses: ./.github/actions/install-shank
if: inputs.shank == 'true'
30 changes: 30 additions & 0 deletions .github/actions/install-linux-build-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Install Linux Build Deps
runs:
using: "composite"
steps:
- name: apt-get add llvm-snapshot key and update
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
sudo apt-get update
shell: bash

- name: apt-get install clang
run: |
sudo apt-get install -y clang-7 --allow-unauthenticated
clang-7 --version
shell: bash

- name: apt-get install ssl libs
run: |
sudo apt-get install -y openssl --allow-unauthenticated
sudo apt-get install -y libssl-dev --allow-unauthenticated
sudo apt-get install -y libssl1.1 --allow-unauthenticated
shell: bash

- name: apt-get install dev tools
run: |
sudo apt-get install -y libudev-dev
sudo apt-get install -y binutils-dev
sudo apt-get install -y libunwind-dev
shell: bash
37 changes: 37 additions & 0 deletions .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Install Rust

inputs:
toolchain:
description: The Rust version to use, default env.RUST_TOOLCHAIN
required: true

runs:
using: "composite"
steps:
- name: Install Rust Stable
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
override: true
profile: minimal
components: rustfmt, clippy

- name: Add Cargo bin to Path
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
shell: bash

- name: Verify Rust install
run: |
echo "Verifying rust '${{ inputs.toolchain }}' ..."
rustc --version
cargo --version
cargo clippy --version
rustfmt --version
shell: bash

- name: Share rustc hash
run: |
echo 'RUSTC_HASH=${{ steps.rust_toolchain.outputs.rustc_hash }}' >> $GITHUB_ENV
shell: bash
17 changes: 17 additions & 0 deletions .github/actions/install-shank/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# if referencing from a workflow, SHANK_VERSION environment variable must be defined
name: Setup Shank CLI
description: 'Setup Shank CLI'

runs:
using: 'composite'
steps:
- uses: actions/cache@v2
name: Cache Shank CLI
id: cache-shank-cli
with:
path: /home/runner/.cargo/bin/shank
key: shank-cli-${{ runner.os }}-v${{ env.SHANK_VERSION }}

- run: cargo install --git https://github.com/metaplex-foundation/shank --tag "shank-cli@v$SHANK_VERSION" shank-cli --locked
shell: bash
if: steps.cache-shank-cli.outputs.cache-hit != 'true'
40 changes: 40 additions & 0 deletions .github/actions/install-solana/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Install Solana

inputs:
solana_version:
description: Version of Solana to install
required: true
default: 1.10.34

runs:
using: "composite"
steps:
- name: Cache Solana Install
if: ${{ !env.ACT }}
id: cache-solana-install
uses: actions/cache@v2
with:
path: "$HOME/.local/share/solana/install/releases/${{ inputs.solana_version }}"
key: ${{ runner.os }}-Solana-v${{ inputs.solana_version }}

- name: Install Solana
if: ${{ !env.ACT }} && steps.cache-solana-install.outputs.cache-hit != 'true'
run: |
sh -c "$(curl -sSfL https://release.solana.com/v${{ inputs.solana_version }}/install)"
shell: bash

- name: Set Active Solana Version
run: |
rm -f "$HOME/.local/share/solana/install/active_release"
ln -s "$HOME/.local/share/solana/install/releases/${{ inputs.solana_version }}/solana-release" "$HOME/.local/share/solana/install/active_release"
shell: bash

- name: Add Solana bin to Path
run: |
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
shell: bash

- name: Verify Solana install
run: |
solana --version
shell: bash
30 changes: 30 additions & 0 deletions .github/actions/yarn-install-and-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Yarn Install and Build

inputs:
cache_id:
description: ID to use in order to cache yarn install
required: true
working_dir:
description: Directory in which to perform the yarn tasks
required: true

runs:
using: composite
steps:
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ inputs.cache_id }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

##############
# Build Contract
##############
- name: Install modules
run: yarn install
working-directory: ${{ inputs.working_dir }}
shell: bash

- name: Build TypeScript
run: yarn build
working-directory: ${{ inputs.working_dir }}
shell: bash
Loading

0 comments on commit 5958e28

Please sign in to comment.