diff --git a/.github/workflows/ipfs.yml b/.github/workflows/ipfs.yml deleted file mode 100644 index 9f6b219d0..000000000 --- a/.github/workflows/ipfs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Add to IPFS - -on: [push] - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-go@v2 - with: - go-version: '1.14' - - - uses: actions/setup-node@v2-beta - with: - node-version: '12' - - - run: npm install - - run: npm run build - - # Pin the built site to ipfs-cluster, output the cid as `steps.ipfs.outputs.cid` - # see: https://github.com/ipfs-shipyard/ipfs-github-action - - uses: ipfs-shipyard/ipfs-github-action@v1.0.0 - id: ipfs - with: - path_to_add: public - cluster_host: /dnsaddr/cluster.ipfs.io - cluster_user: ${{ secrets.CLUSTER_USER }} - cluster_password: ${{ secrets.CLUSTER_PASSWORD }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - run: echo /ipfs/${{ steps.ipfs.outputs.cid }} - - - run: echo ${{ github.ref }} - - # This branch updates a dnslink for a domain if the current branch should be deployed to prod. - # see https://github.com/ipfs-shipyard/js-dnslink-dnsimple - - run: npx dnslink-dnsimple --domain beta.spec.filecoin.io --link /ipfs/${{ steps.ipfs.outputs.cid }} - env: - DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }} - # TODO: change to master once merged. - if: github.ref == 'refs/heads/feat/new-setup' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88a2d336a..06494d951 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,70 +1,44 @@ -name: github pages deploy +name: CI -on: - push: - branches: - - master +on: [push] jobs: - build-deploy: + deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - with: - submodules: true + - uses: actions/checkout@v2 - - uses: webfactory/ssh-agent@v0.2.0 + - uses: actions/setup-go@v2 with: - ssh-private-key: ${{ secrets.ACTIONS_DEPLOY_KEY }} - - - name: Install Go - run: | - sudo apt-get remove golang-go - sudo apt-get remove --auto-remove golang-go - sudo rm -rf /usr/local/go - sudo rm -rf /usr/local/go1.12 - sudo rm -rf /usr/local/go1.27 - sudo apt-get update - wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz - sudo tar -xvf go1.14.4.linux-amd64.tar.gz - sudo chown -R root:root ./go - sudo cp -r go /usr/local - sudo cp -r go /usr/local/go1.12 - sudo cp -r go /usr/local/go1.27 - sudo ln -sf /usr/local/go/bin/go /usr/bin/go - sudo echo 'GOROOT=/usr/local/go' >> ~/.profile - sudo echo 'GOPATH=$HOME/work' >>~/.profile - sudo echo 'PATH=$GOROOT/bin:$GOPATH/bin' >>~/.profile - source ~/.profile - - - name: Debug - run: | - pwd - go env - which go - go version - - - name: Install deps-ga - run: | - sudo make deps-ga + go-version: '1.14' - - name: Build - run: | - sudo chown -R root:root /home/runner/work/specs - sudo make build - - - name: Deploy using SSH + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + + - run: npm install + - run: npm run build + + # Pin the built site to ipfs-cluster, output the cid as `steps.ipfs.outputs.cid` + # see: https://github.com/ipfs-shipyard/ipfs-github-action + - uses: ipfs-shipyard/ipfs-github-action@v1.0.0 + id: ipfs + with: + path_to_add: public + cluster_host: /dnsaddr/cluster.ipfs.io + cluster_user: ${{ secrets.CLUSTER_USER }} + cluster_password: ${{ secrets.CLUSTER_PASSWORD }} env: - DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - sudo chown -R runner /home/runner/work/specs/specs - sudo chown -R runner .git/ - eval "$(ssh-agent -s)" - ssh-add - <<< "${DEPLOY_KEY}" + + - run: echo /ipfs/${{ steps.ipfs.outputs.cid }} - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - git config --local user.email "no-reply-spec-deploy@protocol.ai" - git config --local user.name "no-reply-spec-deploy" + - run: echo ${{ github.ref }} - bin/publish-to-gh-pages.sh + # This branch updates a dnslink for a domain if the current branch should be deployed to prod. + # see https://github.com/ipfs-shipyard/js-dnslink-dnsimple + - run: npx dnslink-dnsimple --domain beta.spec.filecoin.io --link /ipfs/${{ steps.ipfs.outputs.cid }} + env: + DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }} + # TODO: change to master once merged. + if: github.ref == 'refs/heads/feat/new-setup' diff --git a/README.md b/README.md index bdd0ae914..e83132207 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# Filecoin Specification + +This is the [Filecoin Specification](https://github.com/filecoin-project/specs), a repository that contains documents, code, models, and diagrams that constitute the specification of the [Filecoin Protocol](https://filecoin.io). This repository is the singular source of truth for the Filecoin Protocol. All implementations of the Filecoin Protocol should match and comply with the descriptions, interfaces, code, and models defined in this specification. + +Note that the `beta` branch of the specs moves quickly. We work to merge PRs as fast as possible into master, which means changes or reversals are possible here. Accordingly, we periodically compile swaths of spec along with a high-level difflog into the `release` branch. As the spec stabilizes, this practice will change. + +## Website + +https://beta.spec.filecoin.io is the user-friendly website rendering, which we recommend for reading this repository. The website is updated automatically with every merge to `beta`. + ## Install ```sh @@ -17,7 +27,33 @@ brew install go yarn serve # open http://localhost:1313/ in the browser ``` -# Shortcodes + +### External modules +External modules should be added as [Hugo Modules](https://gohugo.io/hugo-modules/) +You can find examples in the `config.toml` + +```toml +[module] + [[module.imports]] + path = "github.com/filecoin-project/specs-actors" + [[module.imports.mounts]] + source = "actors" + target = "content/modules/actors" +``` +This makes files from external repos available for Hugo rendering. + +These modules can be updated with + +```sh +hugo mod get -u +``` +or use specific version with + +```sh +hugo mod get github.com/filecoin-project/specs-actors@v0.7.2 +``` + +## Shortcodes ### `Mermaid` Inline mermaid syntax rendering ```html @@ -65,8 +101,26 @@ stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa {{}} ``` +## Page Header +The first heading should be # Head with `---` like below and should refer to the overall title of the document. The right nav **only** starts on the second level of headings. -# Frontmatter +```md +--- +title: Storage Power Actor +--- + +# Storage Power Actor +--- + +## Header for a section in this document +Some text + +### Sub header for the a nested section + +## Another top level header +``` + +## Frontmatter ```md title: Libraries description: Libraries used from Filecoin @@ -78,9 +132,9 @@ dashboardState: wip dashboardInterface: stable ``` -# Code fences +## Code fences -They should **always** have a lang, if you don't know or don't care just use `text` +Code fences should **always** have a lang, if you don't know or don't care just use `text` ```text @@ -89,32 +143,14 @@ Random plain text context ... `` ``` -# Document header -The first heading should be # Head with `---` like below and should refer to the overall title of the document. The right nav **only** starts on the second level of headings. -```md ---- -title: Storage Power Actor ---- -# Storage Power Actor ---- - -## Header for a section in this document -Some text - -### Sub header for the a nested section - -## Another top level header -``` - - -# References -## Markdown links **(Recommended)** +## References +### Markdown links **(Recommended)** These links use "portable links" just like `relref` so you can just give it the name of the file and it will fetch the correct relative link and title for the `` automatically. You can override the `` title by passing a second `string` in the link definition. -**Note**: When using anchors the title can't be fetched automatically. +> **Note**: When using anchors the title can't be fetched automatically. ```md [Storage Power](storage_power_consensus) # Storage Power @@ -127,13 +163,13 @@ You can override the `` title by passing a second `string` in the link defini ``` -## Hugo Cross Refs +### Hugo Cross Refs Check Hugo's documentation [here](https://gohugo.io/content-management/shortcodes/#ref-and-relref) ```md [Random]({{}}) [Pledge Collateral]({{}}) ``` -## Link shortcode +### Link shortcode Theres also `link` shortcode which will fetch the title of the page automatically and use it for the `` text and title, but **DOES NOT** work with anchors (`#anchor-id`) ```md {{}}