105 lines
3.7 KiB
YAML
105 lines
3.7 KiB
YAML
name: Release
|
|
on:
|
|
# every morning
|
|
schedule:
|
|
- cron: '0 12 * * *'
|
|
|
|
# releases are triggered on changes to this file
|
|
push:
|
|
branches:
|
|
- v2
|
|
paths:
|
|
- '.github/workflows/release.yaml'
|
|
|
|
jobs:
|
|
bump_version:
|
|
name: Bump Version
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_tag: ${{ steps.github_tag_action.outputs.new_tag }}
|
|
changelog: ${{ steps.github_tag_action.outputs.changelog }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Bump version and push tag
|
|
id: github_tag_action
|
|
uses: mathieudutour/github-tag-action@v4.2
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
release_branches: .*
|
|
|
|
create_release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
needs: bump_version
|
|
if: ${{ needs.bump_version.outputs.new_tag != null }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12'
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --ignore-scripts --frozen-lockfile
|
|
|
|
- name: Build the IPFS bundle
|
|
run: yarn ipfs-build
|
|
|
|
- name: Pin to IPFS
|
|
id: upload
|
|
uses: anantaramdas/ipfs-pinata-deploy-action@v1.5.2
|
|
with:
|
|
pin-name: Uniswap ${{ needs.bump_version.outputs.new_tag }}
|
|
path: './build'
|
|
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
|
|
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}
|
|
|
|
- name: Convert CIDv0 to CIDv1
|
|
id: convert_cidv0
|
|
uses: uniswap/convert-cidv0-cidv1@v1.0.0
|
|
with:
|
|
cidv0: ${{ steps.upload.outputs.hash }}
|
|
|
|
- name: Update DNS with new IPFS hash
|
|
uses: uniswap/replace-vercel-dns-records@v1.0.0
|
|
with:
|
|
domain: 'uniswap.org'
|
|
subdomain: '_dnslink.app'
|
|
record-type: 'TXT'
|
|
value: /ipfs/${{ steps.upload.outputs.hash }}
|
|
token: ${{ secrets.VERCEL_TOKEN }}
|
|
team-name: 'uniswap'
|
|
|
|
- name: Create GitHub Release
|
|
id: create_release
|
|
uses: actions/create-release@v1.1.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ needs.bump_version.outputs.new_tag }}
|
|
release_name: Release ${{ needs.bump_version.outputs.new_tag }}
|
|
body: |
|
|
Release built from commit [`${{ github.sha }}`](https://github.com/Uniswap/uniswap-frontend/tree/${{ github.sha }})
|
|
|
|
The IPFS hash of the bundle is:
|
|
- CIDv0: `${{ steps.upload.outputs.hash }}`
|
|
- CIDv1: `${{ steps.convert_cidv0.outputs.cidv1 }}`
|
|
|
|
Uniswap uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to store your settings.
|
|
**Beware** that other sites you access via the _same_ IPFS gateway can read and modify your settings on Uniswap without your permission.
|
|
You can avoid this issue by using a subdomain IPFS gateway. The preferred gateway URLs below utilize the CIDv1 of the release in the subdomain, and are relatively safer.
|
|
|
|
Preferred URLs:
|
|
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/
|
|
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.cf-ipfs.com/
|
|
- [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload.outputs.hash }}/)
|
|
|
|
Other IPFS gateways:
|
|
- https://cloudflare-ipfs.com/ipfs/${{ steps.upload.outputs.hash }}/
|
|
- https://ipfs.infura.io/ipfs/${{ steps.upload.outputs.hash }}/
|
|
- https://ipfs.io/ipfs/${{ steps.upload.outputs.hash }}/
|
|
|
|
${{ needs.bump_version.outputs.changelog }} |