delete all devhub components and redeploy (not to be merged) #107
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Widgets to Mainnet - Devhub | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
deploy-widgets: | |
runs-on: ubuntu-latest | |
name: Deploy ( or diff from PR ) - Devhub | |
environment: devhub.near | |
defaults: | |
run: | |
working-directory: ./instances/devhub.near | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set replacements | |
id: set_replacements | |
run: | | |
echo "replacements=$(jq -r '[to_entries[] | .["find"] = "${" + .key + "}" | .["replace"] = .value | del(.key, .value), {"find": "${REPL_POSTHOG_API_KEY}", "replace": "'${{ secrets.POSTHOG_API_KEY }}'"}]' aliases.mainnet.json | tr -d "\n\r")" >> $GITHUB_OUTPUT | |
- name: Replace placeholders | |
uses: flcdrg/replace-multiple-action@v1 | |
with: | |
files: "**/*.jsx" | |
find: "${{ steps.set_replacements.outputs.replacements }}" | |
prefix: "(^|.*)" | |
suffix: "($|.*)" | |
- name: Install dependencies | |
run: | | |
# npm ci | |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh | |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh | |
- name: Deploy widgets | |
run: | | |
BRANCH="$(git rev-parse --abbrev-ref HEAD)" | |
echo "on branch $BRANCH" | |
if [[ "$BRANCH" != "main" ]]; then | |
echo "Not on main branch, dry run by diff with devhub.near" | |
#npm run dry-run:devhub | |
#bos components delete devhub.near selected core.common,core.adapter.devhub-contract,core.lib.url,core.lib.stringUtils,core.lib.struct,core.lib.autocomplete,core.lib.common,core.lib.data-request,core.lib.uuid,devhub.page.profile,devhub.page.blogv2,devhub.page.blog,devhub.page.about,devhub.page.admin.restrictedLabelsTab,devhub.page.admin.AccountsEditor,devhub.page.admin.homepageTab,devhub.page.admin.index,devhub.page.admin.moderatorsTab,devhub.page.proposals,devhub.page.announcements sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.page.feed,devhub.page.community.index,devhub.page.community.configuration,devhub.page.create,devhub.page.home,devhub.notification.Left,devhub.notification.Item,devhub.notification.Right,devhub.notification.LR,devhub.entity.post.draft,devhub.entity.post.Postv2,devhub.entity.proposal.Proposal,devhub.entity.proposal.ConfirmReviewModal,devhub.entity.proposal.History,devhub.entity.proposal.Profile,devhub.entity.proposal.CommentIcon,devhub.entity.proposal.AcceptedTerms,devhub.entity.proposal.CategoryTag,devhub.entity.proposal.LoginScreen,devhub.entity.proposal.VerificationStatus sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.entity.proposal.CategoryDropdown,devhub.entity.proposal.LikeButton,devhub.entity.proposal.ComposeComment,devhub.entity.proposal.TermsAndConditions,devhub.entity.proposal.CommentsAndLogs,devhub.entity.proposal.MultiSelectLabelsDropdown,devhub.entity.proposal.Feed,devhub.entity.proposal.LinkedProposalsDropdown,devhub.entity.proposal.StatusTag,devhub.entity.proposal.ConfirmCancelModal,devhub.entity.proposal.Comments,devhub.entity.proposal.Editor,devhub.entity.proposal.AccountInput,devhub.entity.team.Configurator,devhub.entity.team.LabelPermissions,devhub.entity.team.LabelRow,devhub.entity.addon.blogv2.Blog,devhub.entity.addon.blogv2.Page,devhub.entity.addon.blogv2.Configurator,devhub.entity.addon.blogv2.Viewer sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.entity.addon.blogv2.Card,devhub.entity.addon.blogv2.editor.BlogPostSettings,devhub.entity.addon.blogv2.editor.layout,devhub.entity.addon.blogv2.editor.form,devhub.entity.addon.blogv2.editor.provider,devhub.entity.addon.blogv2.editor.CategoryDropdown,devhub.entity.addon.blogv2.editor.BlogOverview,devhub.entity.addon.blogv2.editor.index,devhub.entity.addon.blogv2.editor.ConfirmModal,devhub.entity.addon.blogv2.editor.content,devhub.entity.addon.blog.Page,devhub.entity.addon.blog.Feed,devhub.entity.addon.blog.editor.provider,devhub.entity.addon.blog.editor.sidebar,devhub.entity.addon.blog.editor.index,devhub.entity.addon.blog.editor.content,devhub.entity.addon.github.kanban_ticket,devhub.entity.addon.github.kanban_board,devhub.entity.addon.kanban.post_board,devhub.entity.addon.kanban.post_ticket sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.entity.addon.telegram.Configurator,devhub.entity.addon.telegram.Viewer,devhub.entity.community.configuration.InformationConfigurator,devhub.entity.community.Activity,devhub.entity.community.Provider,devhub.entity.community.Teams,devhub.entity.community.Announcements,devhub.entity.community.Sidebar,devhub.entity.community.Tile,devhub.entity.community.Discussions,devhub.entity.community.Compose,devhub.components.atom.Tag,devhub.components.atom.Alert,devhub.components.layout.LikeButton.Faces,devhub.components.organism.Configurator,devhub.components.organism.Feed,devhub.components.organism.Feed.NearQueryApi,devhub.components.organism.Navbar,devhub.components.organism.NewsLetter,devhub.components.feed.SubscribedFeed sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.components.feed.MergedIndexFeed,devhub.components.island.explore,devhub.components.island.hero,devhub.components.island.participate,devhub.components.island.connect,devhub.components.molecule.PostControls,devhub.components.molecule.ShareButton,devhub.components.molecule.BadgeDetails,devhub.components.molecule.BlogControl,devhub.components.molecule.DropDown,devhub.components.molecule.ProfileCard,devhub.components.molecule.Switch,devhub.components.molecule.Input,devhub.components.molecule.Select,devhub.components.molecule.CommunityControl,devhub.components.molecule.Spinner,devhub.components.molecule.Checkbox,devhub.components.molecule.AccountAutocomplete,devhub.components.molecule.Button,devhub.components.molecule.ShareLinkButton sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected devhub.components.molecule.Tile,devhub.components.molecule.ListEditor,devhub.components.molecule.SimpleMDE,devhub.components.molecule.Compose,devhub.components.molecule.ProfileLine,devhub.components.molecule.DropDownWithSearch,devhub.feature.post-search.by-tag,devhub.feature.post-search.by-author,devhub.feature.proposal-search.by-sort,devhub.feature.proposal-search.by-category,devhub.feature.proposal-search.by-author,devhub.feature.proposal-search.by-input,devhub.feature.proposal-search.by-stage,DevGov.Notification.Item.Left,DevGov.Notification.Item.Right,components.core.lib.contract,components.organism.Navbar,components.template.AppLayout,components.admin.AccountsEditor,components.admin.AboutConfigurator sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components delete devhub.near selected components.admin.ModeratorsConfigurator,components.rfps.CommentsAndLogs,components.rfps.WarningModal,components.rfps.ViewRfpModal,components.rfps.Rfp,components.rfps.Feed,components.rfps.StatusTag,components.rfps.ConfirmCancelModal,components.rfps.StageDropdown,components.rfps.TimelineConfigurator,components.rfps.Editor,components.molecule.RadioButton,components.molecule.DropDown,components.molecule.LinkedRfps,components.molecule.LinkedProposals,components.molecule.LikeButton,components.molecule.ComposeComment,components.molecule.FilterByLabel,components.molecule.LinkedRfpDropdown,components.molecule.Markdown sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
# only try deploying a few components | |
#rm widget/app.jsx | |
rm -Rf widget/core | |
rm -Rf widget/devhub | |
rm -Rf widget/DevGov | |
#bos components delete devhub.near selected components.molecule.LinkedProposalsDropdown,components.molecule.NavbarDropdown,components.molecule.SimpleMDE,components.molecule.Compose,components.molecule.DropDownWithSearch,components.molecule.MultiSelectCategoryDropdown,components.molecule.AccountInput,components.pages.about,components.pages.admin,components.proposals.Proposal,components.proposals.ViewProposalModal,components.proposals.CommentsAndLogs,components.proposals.Feed,components.proposals.Editor sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
#bos components deploy '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
node create-components.mjs | |
near contract call-function as-transaction social.near set file-args components.json prepaid-gas '300.0 Tgas' attached-deposit '0 NEAR' sign-as devhub.near network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
else | |
bos components deploy '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' sign-as '${{ vars.NEAR_SOCIAL_ACCOUNT_ID }}' network-config mainnet sign-with-plaintext-private-key --signer-public-key '${{ vars.NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY }}' --signer-private-key '${{ secrets.NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY }}' send | |
fi |