-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0c8f94
commit 0a0427f
Showing
31 changed files
with
83 additions
and
13,887 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: thirdweb | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
deploy_or_publish: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
deploy_output: ${{ steps.deploy.outputs.stdout }} | ||
publish_output: ${{ steps.publish.outputs.stdout }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: deploy | ||
id: deploy | ||
if: github.event_name == 'pull_request' || github.ref != format('refs/heads/{0}', github.event.repository.default_branch) | ||
run: | | ||
DEPLOY=$(npx thirdweb deploy --ci | grep http) | ||
echo "::set-output name=stdout::$DEPLOY" | ||
echo "deploy_url: $DEPLOY" | ||
- name: publish | ||
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | ||
id: publish | ||
run: | | ||
PUBLISH=$(npx thirdweb publish --ci | grep http) | ||
echo "::set-output name=stdout::$PUBLISH" | ||
echo "publish_url: $PUBLISH" | ||
comment_on_commit: | ||
runs-on: ubuntu-latest | ||
needs: [deploy_or_publish] | ||
if: github.event_name == 'push' | ||
steps: | ||
- name: Comment on commit (publish) | ||
uses: peter-evans/commit-comment@v2 | ||
if: ${{ needs.deploy_or_publish.outputs.publish_output != '' }} | ||
with: | ||
body: | | ||
Contract compiled, publish using the button below | ||
<p> | ||
<a href="${{ needs.deploy_or_publish.outputs.publish_output }}"><img width="120px" src="https://gateway.thirdweb.dev/ipfs/QmS6gcgu3QynRQ4xBEJVL8xNycMyPNW4Da9RgzTswmxQzf/0.svg" /></a> | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Comment on commit (deploy) | ||
uses: peter-evans/commit-comment@v2 | ||
if: ${{ needs.deploy_or_publish.outputs.deploy_output != '' }} | ||
with: | ||
body: | | ||
Contract compiled, deploy using the button below | ||
<p> | ||
<a href="${{ needs.deploy_or_publish.outputs.deploy_output }}"><img width="120px" src="https://gateway.thirdweb.dev/ipfs/QmdS2yxCteNePeAw9h7dnaSvorNA1AMYCtX4DuG15YR3jo/0.svg" /></a> | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
comment_on_pr: | ||
runs-on: ubuntu-latest | ||
needs: [deploy_or_publish] | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Comment on PR | ||
uses: thollander/actions-comment-pull-request@v1 | ||
with: | ||
message: | | ||
Contract compiled, deploy using the button below | ||
<p> | ||
<a href="${{ needs.deploy_or_publish.outputs.deploy_output }}"><img width="120px" src="https://gateway.thirdweb.dev/ipfs/QmdS2yxCteNePeAw9h7dnaSvorNA1AMYCtX4DuG15YR3jo/0.svg" /></a> | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.