Skip to content

Commit 07df03a

Browse files
authored
Merge pull request #129 from cowprotocol/release/2.1.0
Release/2.1.0
2 parents 7b3ee4b + 056e2c1 commit 07df03a

File tree

222 files changed

+722
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+722
-22
lines changed

.github/ISSUE_TEMPLATE/addImageForm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Add Image
22
description: Creates a request to add a token image to CoW Swap's image repository
33
title: "[AddImage] `SYMBOL` on `NETWORK`"
4-
labels: []
4+
labels: [addImage]
55

66
body:
77
- type: markdown

.github/ISSUE_TEMPLATE/addTokenForm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Add Token
22
description: Creates a request to add a token to CoW Swap's default token list
33
title: "[AddToken] `SYMBOL` on `NETWORK`"
4-
labels: []
4+
labels: [addToken]
55

66
body:
77
- type: markdown
@@ -65,6 +65,7 @@ body:
6565
- type: textarea
6666
id: reason
6767
attributes:
68-
label: Why should we add this token? How do we know it's not a scam? Does it have enough liquidity on selected chain?
68+
label: Reason
69+
description: Why should we add this token? How do we know it's not a scam? Does it have enough liquidity on selected chain?
6970
validations:
7071
required: true

.github/ISSUE_TEMPLATE/other.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Other
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
assignees: ''
6+
7+
---
8+
9+

.github/ISSUE_TEMPLATE/removeTokenForm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Remove Token
22
description: Creates a request to remove a token from CoW Swap's default token list
33
title: "[RemoveToken] `SYMBOL` on `NETWORK`"
4-
labels: []
4+
labels: [removeToken]
55

66
body:
77
- type: markdown
@@ -36,6 +36,7 @@ body:
3636
- type: textarea
3737
id: reason
3838
attributes:
39-
label: Why should we remove this token?
39+
label: Reason
40+
description: Why should we remove this token?
4041
validations:
4142
required: true
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: ExecuteAction
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
issueInfo:
7+
required: true
8+
type: string
9+
operation:
10+
required: true
11+
type: string
12+
prTitle:
13+
required: true
14+
type: string
15+
prBody:
16+
required: true
17+
type: string
18+
19+
env:
20+
IMAGES_BASE_PATH: src/public/images/
21+
LIST_PATH: src/public/CowSwap.json
22+
23+
jobs:
24+
execute:
25+
runs-on: ubuntu-latest
26+
steps:
27+
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
31+
- name: Set BASE_PATH env var
32+
run: echo "BASE_PATH=${{ env.IMAGES_BASE_PATH }}${{ fromJSON(inputs.issueInfo).chainId }}/${{ fromJSON(inputs.issueInfo).address }}/" >> "$GITHUB_ENV"
33+
34+
- name: Create base path and info.json if it doesn't exist
35+
run: |
36+
mkdir -p ${{ env.BASE_PATH }}
37+
touch "${{ env.BASE_PATH }}info.json"
38+
39+
- name: Save input into local file
40+
run: |
41+
cat << EOF > data.json
42+
${{ inputs.issueInfo }}
43+
EOF
44+
45+
# Image handling
46+
- name: Download image
47+
if: ${{ inputs.operation == 'addImage' || inputs.operation == 'addToken' }}
48+
uses: actions/download-artifact@v3
49+
with:
50+
name: ${{ fromJSON(inputs.issueInfo).address }}
51+
52+
- name: Move image to destination
53+
if: ${{ inputs.operation == 'addImage' || inputs.operation == 'addToken' }}
54+
run: mv output.png ${{ env.BASE_PATH }}logo.png
55+
56+
- name: Update json files
57+
run: python3 src/scripts/workflow_helper.py ${{ inputs.operation }} data.json
58+
59+
- name: Create Pull Request
60+
id: cpr
61+
uses: peter-evans/create-pull-request@v4
62+
with:
63+
commit-message: "[${{ inputs.operation }}] ${{ fromJSON(inputs.issueInfo).network }}/${{ fromJSON(inputs.issueInfo).address }}"
64+
branch: ${{ inputs.operation }}/${{ fromJSON(inputs.issueInfo).chainId }}_${{ fromJSON(inputs.issueInfo).address }}
65+
delete-branch: true
66+
title: ${{ inputs.prTitle }}
67+
body: |
68+
# ${{ inputs.operation }}
69+
70+
**Note** This is an automated PR
71+
72+
Submitted by @${{ github.event.issue.user.login }}
73+
74+
Closes #${{ github.event.issue.number }}
75+
76+
---
77+
78+
${{ inputs.prBody }}
79+
add-paths: |
80+
${{ env.BASE_PATH }}/*
81+
${{ env.LIST_PATH }}
82+
83+
- name: Comment on issue
84+
uses: peter-evans/create-or-update-comment@v2
85+
with:
86+
issue-number: ${{ github.event.issue.number }}
87+
body: |
88+
Your request is ready and will be reviewed by a team member.
89+
You can follow the progress in the Pull Request #${{ steps.cpr.outputs.pull-request-number }}
90+
91+
- name: Report error
92+
if: ${{ failure() }}
93+
uses: peter-evans/close-issue@v2
94+
with:
95+
comment: |
96+
Failed to ${{ inputs.operation }}
97+
98+
Check the input is correct and try again in a new issue
99+
100+
If the issue persists, create a bug report
101+
102+
cc @cowprotocol/frontend
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: OptimizeImage
2+
3+
# Input: chain, address, CID
4+
# Steps:
5+
# - resolve image/download it
6+
# - optimize image: 256x256, remove metadata
7+
# - upload new image to ipfs: name file <address>.png, upload it
8+
# - return CID
9+
10+
on:
11+
workflow_call:
12+
inputs:
13+
address:
14+
required: true
15+
type: string
16+
url:
17+
required: true
18+
type: string
19+
20+
jobs:
21+
execute:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Download image
25+
run: "curl -o image.png ${{ inputs.url }}"
26+
27+
- name: Install imagemagick
28+
run: sudo apt install imagemagick
29+
30+
- name: Optimize image
31+
run: "convert image.png -depth 7 -resize 256x -posterize 24 output.png"
32+
33+
# - name: Further compress image
34+
# run: "??? still need to figure out how to do this without imageoptim"
35+
36+
- name: Upload img
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: ${{ inputs.address }}
40+
path: output.png
41+
retention-days: 1
42+
43+
- name: Report error
44+
if: ${{ failure() }}
45+
uses: peter-evans/close-issue@v2
46+
with:
47+
comment: |
48+
Failed to optimize image
49+
50+
Check you provided a proper image file and try again in a new issue
51+
52+
If the issue persists, create a bug report
53+
54+
cc @cowprotocol/frontend

0 commit comments

Comments
 (0)