11name : Release
22on :
33 schedule :
4- - cron : ' 0 12 * * 1-4' # every day 12:00 UTC Monday-Thursday
5-
4+ - cron : ' 0 12 * * 1-4' # every day 12:00 UTC Monday-Thursday
65 # manual trigger
76 workflow_dispatch :
87
98jobs :
10- bump_version :
11- name : Bump Version
9+ wait-on-tests :
1210 runs-on : ubuntu-latest
13- outputs :
14- new_tag : ${{ steps.github_tag_action.outputs.new_tag }}
15- changelog : ${{ steps.github_tag_action.outputs.changelog }}
1611 steps :
17- - name : Checkout
18- uses : actions/checkout@v2
12+ - id : unit-tests
13+ uses :
fountainhead/[email protected] 14+ with :
15+ token : ${{ secrets.GITHUB_TOKEN }}
16+ checkName : unit-tests
17+ - id : cypress-tests
18+ uses :
fountainhead/[email protected] 19+ with :
20+ token : ${{ secrets.GITHUB_TOKEN }}
21+ checkName : cypress-tests
22+ - if : steps.unit-tests.outputs.conclusion != 'success' || steps.cypress-tests.outputs.conclusion != 'success'
23+ run : exit 1
1924
20- - name : Bump version and push tag
21- id : github_tag_action
22- uses : mathieudutour/github-tag-action@331898d5052eedac9b15fec867b5ba66ebf9b692
25+ tag :
26+ needs : wait-on-tests
27+ runs-on : ubuntu-latest
28+ outputs :
29+ new_tag : ${{ steps.github-tag-action.outputs.new_tag }}
30+ changelog : ${{ steps.github-tag-action.outputs.changelog }}
31+ steps :
32+ - uses : actions/checkout@v3
33+ - name : Bump and tag
34+ id : github-tag-action
35+ uses :
mathieudutour/[email protected] 2336 with :
2437 github_token : ${{ secrets.GITHUB_TOKEN }}
2538 release_branches : .*
26- default_bump : false
39+ default_bump : patch
2740
28- create_release :
29- name : Create Release
41+ release :
42+ needs : tag
43+ if : ${{ needs.tag.outputs.new_tag != null }}
3044 runs-on : ubuntu-latest
31- needs : bump_version
32- if : ${{ needs.bump_version.outputs.new_tag != null }}
3345 steps :
34- - name : Checkout
35- uses : actions/checkout@v2
36-
37- - name : Set up node
38- uses : actions/setup-node@v2
39- with :
40- node-version : 14
41- registry-url : https://registry.npmjs.org
42-
43- - name : Install dependencies
44- run : yarn install --frozen-lockfile
45-
46- - name : Build the IPFS bundle
47- run : yarn build
46+ - uses : actions/checkout@v3
47+ - uses : ./.github/actions/setup
48+ - run : yarn prepare
49+ - run : yarn build
4850
4951 - name : Pin to IPFS
50- id : upload
52+ id : pinata
5153 uses : anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
5254 with :
53- pin-name : Uniswap ${{ needs.bump_version .outputs.new_tag }}
55+ pin-name : Uniswap ${{ needs.tag .outputs.new_tag }}
5456 path : ' ./build'
5557 pinata-api-key : ${{ secrets.PINATA_API_KEY }}
5658 pinata-secret-api-key : ${{ secrets.PINATA_API_SECRET_KEY }}
@@ -64,10 +66,24 @@ jobs:
6466 seeds : ${{ secrets.CRUST_SEEDS }}
6567
6668 - name : Convert CIDv0 to CIDv1
67- id : convert_cidv0
69+ id : convert-cidv0
68706971 with :
70- cidv0 : ${{ steps.upload.outputs.hash }}
72+ cidv0 : ${{ steps.pinata.outputs.hash }}
73+
74+ - uses : actions/cache@v3
75+ id : cypress-cache
76+ with :
77+ path : /home/runner/.cache/Cypress
78+ key : ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
79+ - if : steps.cypress-cache.outputs.cache-hit != 'true'
80+ run : yarn cypress install
81+ - uses : cypress-io/github-action@v4
82+ with :
83+ install : false
84+ browser : chrome
85+ config-file : cypress.release.config.ts
86+ config : baseUrl=https://cloudflare-ipfs.com/ipfs/${{ steps.pinata.outputs.hash }}
7187
7288 - name : Update DNS with new IPFS hash
7389 env :
@@ -77,20 +93,19 @@ jobs:
7793 CLOUDFLARE_ZONE_ID : ${{ secrets.CLOUDFLARE_ZONE_ID }}
7894 uses : textileio/cloudflare-update-dnslink@0fe7b7a1ffc865db3a4da9773f0f987447ad5848
7995 with :
80- cid : ${{ steps.upload .outputs.hash }}
96+ cid : ${{ steps.pinata .outputs.hash }}
8197
82- - name : Create GitHub Release
83- id : create_release
98+ - name : Release
849985100 env :
86101 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87102 with :
88- tag_name : ${{ needs.bump_version .outputs.new_tag }}
89- release_name : Release ${{ needs.bump_version .outputs.new_tag }}
103+ tag_name : ${{ needs.tag .outputs.new_tag }}
104+ release_name : Release ${{ needs.tag .outputs.new_tag }}
90105 body : |
91106 IPFS hash of the deployment:
92- - CIDv0: `${{ steps.upload .outputs.hash }}`
93- - CIDv1: `${{ steps.convert_cidv0 .outputs.cidv1 }}`
107+ - CIDv0: `${{ steps.pinata .outputs.hash }}`
108+ - CIDv1: `${{ steps.convert-cidv0 .outputs.cidv1 }}`
94109
95110 The latest release is always accessible via our alias to the Cloudflare IPFS gateway at [app.uniswap.org](https://app.uniswap.org).
96111
@@ -100,8 +115,8 @@ jobs:
100115 Your Uniswap settings are never remembered across different URLs.
101116
102117 IPFS gateways:
103- - https://${{ steps.convert_cidv0 .outputs.cidv1 }}.ipfs.dweb.link/
104- - https://${{ steps.convert_cidv0 .outputs.cidv1 }}.ipfs.cf-ipfs.com/
105- - [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload .outputs.hash }}/)
118+ - https://${{ steps.convert-cidv0 .outputs.cidv1 }}.ipfs.dweb.link/
119+ - https://${{ steps.convert-cidv0 .outputs.cidv1 }}.ipfs.cf-ipfs.com/
120+ - [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.pinata .outputs.hash }}/)
106121
107- ${{ needs.bump_version .outputs.changelog }}
122+ ${{ needs.tag .outputs.changelog }}
0 commit comments