-
Notifications
You must be signed in to change notification settings - Fork 525
125 lines (109 loc) · 7.2 KB
/
badge_or_last_milestone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Award badge or comment on last milestone
on:
pull_request_target:
types: [closed]
jobs:
get-delivery-files:
runs-on: ubuntu-latest
outputs:
filenames: ${{ steps.files.outputs.added }}
steps:
- name: Get filenames of any deliveries being added
id: files
uses: Ana06/[email protected]
with:
format: 'json'
filter: |
deliveries/*.md
maintenance_deliveries/*.md
check-needs-badge:
runs-on: ubuntu-latest
needs: get-delivery-files
if: github.event.pull_request.merged == true && needs.get-delivery-files.outputs.filenames != '[]'
outputs:
needs_badge: ${{ steps.badge-check.outputs.check && github.event.pull_request.merged == true }}
needs_last_milestone_comment: ${{ steps.last-milestone.outputs.check && github.event.pull_request.merged == true }}
request_invoice: ${{ github.event.pull_request.merged == true && needs.get-delivery-files.outputs.filenames != '[]' && github.event.pull_request.merged == true }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
filename: ${{ fromJson(needs.get-delivery-files.outputs.filenames) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Parse delivery file
id: parse-delivery
uses: w3f/parse-milestone-delivery-action@master
with:
path: "${{ github.workspace }}/${{ matrix.filename }}"
- name: Get application file
run: wget "https://raw.githubusercontent.com/w3f/Grants-Program/master/applications/${{ steps.parse-delivery.outputs.application_document }}"
- name: Parse application file
id: parse-grant
uses: w3f/parse-grant-application-action@master
with:
path: "${{ steps.parse-delivery.outputs.application_document }}"
- name: Check if this PR needs a badge comment
id: badge-check
# A matrix strategy overwrites outputs, meaning `needs_badge` will be `true` if atleast one of the files matches the following condition.
# This way, there'll only be max 1 comment left per PR
if: steps.parse-delivery.outputs.milestone_number == 1 && steps.parse-grant.outputs.level != 1
run: echo "check=true" >> $GITHUB_OUTPUT
- name: Check if this PR needs a "last milestone" comment
id: last-milestone
if: ${{ !steps.parse-delivery.is_maintenance && steps.parse-delivery.outputs.milestone_number == steps.parse-grant.outputs.total_milestones }}
run: echo "check=true" >> $GITHUB_OUTPUT
comment-badge:
runs-on: ubuntu-latest
needs: check-needs-badge
if: needs.check-needs-badge.outputs.needs_badge
steps:
- name: Leave badge comment if applicable
uses: thollander/[email protected]
with:
message: >
Congratulations on completing the first milestone of this grant!
As part of the Grants Program, we want to help grant recipients acknowledge their grants publicly.
To that end, we've created a [badge for projects](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/grant-badge-guidelines.md)
that successfully deliver their first milestone.
Please use the badge only in reference to the work that has been completed as part of this grant,
so please do not display it on your team or project's homepage unless accompanied by a short description of the grant.
Furthermore, you're now welcome to announce the grant publicly. Please remember to observe the
[foundation's guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/announcement-guidelines.md) in doing so.
If you haven't already, reach out to [email protected] for feedback on your announcement and cross-promotion.<br/><br/>
Thank you for your contribution, and good luck!
If you have any remaining milestone, let us know if you encounter any delays by leaving a comment on the application PR
or submitting an [amendment](https://github.com/w3f/Grants-Program#changes-to-a-grant-after-approval).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-last-milestone:
runs-on: ubuntu-latest
# "comment-badge" in needs so we establish the correct messages order
needs: [comment-badge, check-needs-badge]
# "always()" will make this job run also if one of the needs is not completed;
# in this way, the last_milestone comment will be sent also if the badge comment wasn't
if: always()
steps:
- name: Last milestone comment
if: needs.check-needs-badge.outputs.needs_last_milestone_comment
uses: thollander/[email protected]
with:
message: >
We noticed that this is the last milestone of your project. Congratulations on completing your grant! 🎊<br/>
So, where to from here? First of all, you should join our [Grants Community chat](https://matrix.to/#/!XpynPDLusWUWfDpaqr:matrix.org?via=web3.foundation&via=matrix.org), if you haven't already, so we can stay in touch.
If you are looking for continuative support for your project, there are quite a few options. The main goal of the W3F grants program is to support research as well as early-stage technical projects. If your project still falls under one of those categories, you might want to apply for a follow-up grant. However, depending on your goals and project status, there are other support programs in our ecosystem that might be better suited as the next step. For example, projects with a Business Case/Token should look into the [Substrate Builders Program](https://substrate.io/ecosystem/substrate-builders-program/) or [VC Funding](https://parachains.info/investors) and Common Good projects have a good chance of receiving [Treasury Funding](https://github.com/w3f/Grants-Program#treasury). If you are looking for guidance, the team at https://substrate.io/ecosystem/square-one/ has compiled a list of ecosystem support sources and are happy to help you navigate it.<br/>
For a more comprehensive list, see our [Alternative Funding page](https://w3f.github.io/Grants-Program/funding). Let us know if you have any questions regarding the above. We are more than happy to point you to additional resources and help you determine the best course of action.
Lastly, we hope your W3F grant was a success and we want to thank you for being part of the journey!
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
request-invoice:
runs-on: ubuntu-latest
if: always()
steps:
- name: Request invoice
if: github.event.pull_request.merged == true && needs.get-delivery-files.outputs.filenames != '[]'
uses: thollander/[email protected]
with:
message: >
:coin: Please fill out the [invoice form](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform?usp=pp_url&entry.1070766548=${{github.event.pull_request.html_url}}) in order to initiate the payment process. Thank you!
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}