|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: '0 12 * * 1-4' # every day 12:00 UTC Monday-Thursday |
| 5 | + |
| 6 | + # manual trigger |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + bump_version: |
| 11 | + name: Bump Version |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + new_tag: ${{ steps.github_tag_action.outputs.new_tag }} |
| 15 | + changelog: ${{ steps.github_tag_action.outputs.changelog }} |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Bump version and push tag |
| 21 | + id: github_tag_action |
| 22 | + uses: mathieudutour/github-tag-action@331898d5052eedac9b15fec867b5ba66ebf9b692 |
| 23 | + with: |
| 24 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + release_branches: .* |
| 26 | + |
| 27 | + create_release: |
| 28 | + name: Create Release |
| 29 | + runs-on: ubuntu-latest |
| 30 | + needs: bump_version |
| 31 | + if: ${{ needs.bump_version.outputs.new_tag != null }} |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v2 |
| 35 | + |
| 36 | + - name: Set up node |
| 37 | + uses: actions/setup-node@v2 |
| 38 | + with: |
| 39 | + node-version: 14 |
| 40 | + registry-url: https://registry.npmjs.org |
| 41 | + |
| 42 | + - name: Install dependencies |
| 43 | + run: yarn install --frozen-lockfile |
| 44 | + |
| 45 | + - name: Build the IPFS bundle |
| 46 | + run: yarn build |
| 47 | + |
| 48 | + - name: Pin to IPFS |
| 49 | + id: upload |
| 50 | + uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d |
| 51 | + with: |
| 52 | + pin-name: Uniswap ${{ needs.bump_version.outputs.new_tag }} |
| 53 | + path: './build' |
| 54 | + pinata-api-key: ${{ secrets.PINATA_API_KEY }} |
| 55 | + pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }} |
| 56 | + |
| 57 | + - name: Pin to Crust |
| 58 | + |
| 59 | + continue-on-error: true |
| 60 | + timeout-minutes: 2 |
| 61 | + with: |
| 62 | + cid: ${{ steps.upload.outputs.hash }} |
| 63 | + seeds: ${{ secrets.CRUST_SEEDS }} |
| 64 | + |
| 65 | + - name: Convert CIDv0 to CIDv1 |
| 66 | + id: convert_cidv0 |
| 67 | + |
| 68 | + with: |
| 69 | + cidv0: ${{ steps.upload.outputs.hash }} |
| 70 | + |
| 71 | + - name: Update DNS with new IPFS hash |
| 72 | + env: |
| 73 | + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |
| 74 | + RECORD_DOMAIN: 'uniswap.org' |
| 75 | + RECORD_NAME: '_dnslink.app' |
| 76 | + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} |
| 77 | + uses: textileio/cloudflare-update-dnslink@0fe7b7a1ffc865db3a4da9773f0f987447ad5848 |
| 78 | + with: |
| 79 | + cid: ${{ steps.upload.outputs.hash }} |
| 80 | + |
| 81 | + - name: Create GitHub Release |
| 82 | + id: create_release |
| 83 | + |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 86 | + with: |
| 87 | + tag_name: ${{ needs.bump_version.outputs.new_tag }} |
| 88 | + release_name: Release ${{ needs.bump_version.outputs.new_tag }} |
| 89 | + body: | |
| 90 | + IPFS hash of the deployment: |
| 91 | + - CIDv0: `${{ steps.upload.outputs.hash }}` |
| 92 | + - CIDv1: `${{ steps.convert_cidv0.outputs.cidv1 }}` |
| 93 | +
|
| 94 | + The latest release is always accessible via our alias to the Cloudflare IPFS gateway at [app.uniswap.org](https://app.uniswap.org). |
| 95 | +
|
| 96 | + You can also access the Uniswap Interface directly from an IPFS gateway. |
| 97 | + **BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported. |
| 98 | + **You should always use an IPFS gateway that enforces origin separation**, or our alias to the latest release at [app.uniswap.org](https://app.uniswap.org). |
| 99 | + Your Uniswap settings are never remembered across different URLs. |
| 100 | +
|
| 101 | + IPFS gateways: |
| 102 | + - https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/ |
| 103 | + - https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/ |
| 104 | + - [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload.outputs.hash }}/) |
| 105 | +
|
| 106 | + ${{ needs.bump_version.outputs.changelog }} |
0 commit comments