Skip to content

deploy - mainnet

deploy - mainnet #58

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: deploy - mainnet
env:
node_version: 16
git_email: jpschwartz2@uwalumni.com
on:
workflow_dispatch:
inputs:
newversion:
description: 'npm publish {major,minor,patch}'
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [16]
steps:
- uses: actions/checkout@v3
with:
# fetch full history so things like auto-changelog work properly
fetch-depth: 0
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- run: git config --global user.email "${{ env.git_email }}"
- run: git config --global user.name "${{ github.actor }}"
- name: Install
run: npm ci --ignore-scripts
- name: Test
run: |
npm run lint
npm test
# Create a prerelease tag
- name: Tag
run: npm version ${{ github.event.inputs.newversion }}
- name: Get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Build
run: npm run export
env:
LOTUS_NODE_JSONRPC: 'https://mainnet.glif.host/'
GRAPH_API_URL: 'graph.glif.link/query'
COIN_TYPE: 'f'
HOME_URL: 'https://apps.glif.io'
BLOG_URL: 'https://blog.glif.io'
WALLET_URL: 'https://wallet.glif.io'
SAFE_URL: 'https://safe.glif.io'
EXPLORER_URL: 'https://explorer.glif.io'
VERIFIER_URL: 'https://verify.glif.io'
SENTRY_DSN: 'https://bc9449e8f4fc439f943374373b9a3f7a@o1126745.ingest.sentry.io/6186018'
SENTRY_ENV: 'mainnet'
NODE_STATUS_API_KEY: 'm786191525-b3192b91db66217a44f7d4be'
- name: Deploy-cloudflare
run: |
npm i -g @cloudflare/wrangler
npm run publish:mainnet
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
- name: Changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
- name: Filecoin-archive
id: ipfs
run: npm run store-ipfs
env:
WEB3_STORAGE_TOKEN: ${{ secrets.WEB3_STORAGE_TOKEN }}
- name: Git-push
run: |
git push origin v${{ steps.package-version.outputs.current-version}}
git push origin primary
- name: Release-to-mainnet
uses: softprops/action-gh-release@v1
with:
name: Mainnet release - v${{ steps.package-version.outputs.current-version }}
tag_name: v${{ steps.package-version.outputs.current-version }}
body: |
Visit at: https://${{ steps.ipfs.outputs.cid }}.ipfs.dweb.link
${{ steps.Changelog.outputs.changelog }}