Skip to content

Commit

Permalink
chore: w3console release for production (storacha#402)
Browse files Browse the repository at this point in the history
This PR adds w3console to release please, allowing us to manage releases
for it in the same way as we do for other packages in this repo (and
others). It also updates the publishing configuration to publish to a
"preview" cloudflare pages project for PRs, a "staging" pages project on
merge to main, and the production project when a release please PR is
merged.

The production release is actually published to 2 projects:
`console-web3-storage` and `console-nft-storage` which are separately
built with an environment variable `VITE_W3UP_PROVIDER` specifying the
provider to request for a space.

---------

Co-authored-by: Travis Vachon <travis@dag.house>
  • Loading branch information
Alan Shaw and travis authored Mar 21, 2023
1 parent 66dd20b commit a5abad5
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
token: ${{secrets.GITHUB_TOKEN}}
command: manifest

publish:
name: Publish
needs: release
Expand All @@ -24,6 +25,8 @@ jobs:
strategy:
matrix:
path_released: ${{fromJson(needs.release.outputs.paths_released)}}
exclude:
- path_released: examples/react/w3console
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
Expand All @@ -36,3 +39,66 @@ jobs:
pnpm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-w3console-staging:
name: Publish w3console staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Build staging.console.web3.storage
run: pnpm build
working-directory: examples/react/w3console
env:
VITE_W3UP_PROVIDER: did:web:staging.web3.storage
VITE_W3UP_ACCESS_SERVICE_URL: 'https://w3access-staging.protocol-labs.workers.dev'
VITE_W3UP_ACCESS_SERVICE_DID: 'did:web:staging.web3.storage'
VITE_W3UP_UPLOAD_SERVICE_URL: 'https://staging.up.web3.storage'
VITE_W3UP_UPLOAD_SERVICE_DID: 'did:web:staging.web3.storage'
- name: Publish staging.console.web3.storage
uses: ./.github/actions/preview
with:
path_to_add: examples/react/w3console/dist
web3_token: ${{ secrets.WEB3_TOKEN }}
cf_pages_project: console-web3-storage-staging
cf_account_id: ${{ secrets.CF_ACCOUNT_ID }}
cf_token: ${{ secrets.CF_TOKEN }}

publish-w3console-production:
name: Publish w3console production
needs: release
if: contains(fromJson(needs.release.outputs.paths_released), 'examples/react/w3console')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Build console.web3.storage
run: pnpm build
working-directory: examples/react/w3console
env:
VITE_W3UP_PROVIDER: did:web:web3.storage
- name: Publish console.web3.storage
uses: ./.github/actions/preview
with:
path_to_add: examples/react/w3console/dist
web3_token: ${{ secrets.WEB3_TOKEN }}
dnslink_record: beta.console
dnslink_domain: web3.storage
cf_pages_project: console-web3-storage
cf_account_id: ${{ secrets.CF_ACCOUNT_ID }}
cf_token: ${{ secrets.CF_TOKEN }}
- name: Build console.nft.storage
run: pnpm build
working-directory: examples/react/w3console
env:
VITE_W3UP_PROVIDER: did:web:nft.storage
- name: Publish console.nft.storage
uses: ./.github/actions/preview
with:
path_to_add: examples/react/w3console/dist
web3_token: ${{ secrets.WEB3_TOKEN }}
dnslink_record: beta.console
dnslink_domain: nft.storage
cf_pages_project: console-nft-storage
cf_account_id: ${{ secrets.CF_ACCOUNT_ID }}
cf_token: ${{ secrets.CF_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/w3console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# Enable to publish dnslink on merge to main
# dnslink_record: console
# dnslink_domain: web3.storage
cf_pages_project: w3console
cf_pages_project: console-web3-storage-preview
cf_account_id: ${{ secrets.CF_ACCOUNT_ID }}
cf_token: ${{ secrets.CF_TOKEN }}

Expand Down
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"packages/keyring-core": "2.2.1",
"packages/solid-keyring": "2.1.1",
"packages/react-keyring": "3.0.1",
"packages/vue-keyring": "2.0.2"
"packages/vue-keyring": "2.0.2",
"examples/react/w3console": "0.0.0"
}
4 changes: 3 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

"packages/keyring-core": {},
"packages/uploader-core": {},
"packages/uploads-list-core": {}
"packages/uploads-list-core": {},

"examples/react/w3console": {}
}
}

0 comments on commit a5abad5

Please sign in to comment.