Skip to content

Commit f4982c2

Browse files
Released Candidate rc-1.0.0-preview.2
1 parent ad0b776 commit f4982c2

161 files changed

Lines changed: 46420 additions & 6 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: True
2+
contact_links:
3+
- name: How to Report Bugs
4+
url: https://unity3d.com/unity/qa/bug-reporting
5+
about: Learn how to report a bug using Unity Bug Reporter
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: stat:awaiting triage, type:feature
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Other Issues
3+
about: Use this template for any other non-support related issues
4+
title: ''
5+
labels: stat:awaiting triage
6+
assignees: ''
7+
8+
---
9+
10+
This template is for issues not covered by the other issue categories.

.github/ISSUE_TEMPLATE/support.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Support
3+
about: Have a question or need help with anything?
4+
title: ''
5+
labels: stat:awaiting triage, type:support
6+
assignees: ''
7+
8+
---
9+
10+
Post your questions or problems here.

.github/pull_request_template.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
### Description
2+
3+
_Please fill this section with a description what the pull request is trying to address._
4+
5+
### Changes made
6+
7+
_Please write down a short description of what changes were made._
8+
9+
### Notes
10+
11+
_Please write down any additional notes, remove the section if not applicable._
12+
13+
### Checklist
14+
15+
Before review:
16+
17+
- [ ] Changelog entry added under `Unreleased` section.
18+
- Explains the change in `Modified`, `Fixed`, `Added` sections.
19+
- For API change contains an example snippet and/or migration example.
20+
- If UI or rendering results applies, include screenshots.
21+
- FogBugz ticket attached, example `([case %number%](https://issuetracker.unity3d.com/issues/...))`.
22+
- FogBugz is marked as `Resolved` with `next` release version correctly set.
23+
- [ ] Tests added/changed, if applicable.
24+
- Functional tests.
25+
- Performance tests.
26+
- Integration tests.
27+
- [ ] All Tests passed.
28+
- [ ] Docs for new/changed.
29+
- XmlDoc cross references are set correctly.
30+
- Added explanation how the API works.
31+
- Usage code examples added.
32+
- [ ] The branch name has the respective prefix.
33+
- `bug/` Fixing a bug
34+
- `feature/` New feature implementation
35+
- `perf/` Performance improvement
36+
- `refactor/` A code change that neither fixes a bug nor adds a feature
37+
- `doc/` Added documentation
38+
- `test/` Added Unit Tests
39+
- `build/` Changes that affect the build system or external dependencies
40+
- `ci/` Changes to our CI configuration files and scripts
41+
- `style/` Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
42+
- [ ] Coding Standards are respected.
43+
- [ ] Rebase the branch if possible.
44+
45+
After review:
46+
47+
- [ ] Squash and Merge
48+
- If no merge commits are between commits
49+
- Don't squash commits when they are easier to comprehend the changes when categorized.

.github/workflows/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## GitHub Actions Workflows
2+
3+
See https://github.cds.internal.unity3d.com/actions for a collection of available actions that you may use in your workflows.
4+
5+
File PR for https://github.cds.internal.unity3d.com/unity/actions-syncer to sync new actions, but make sure to use them with a pinned hash for security reasons.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CODEOWNERS validator
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
# we trigger validation on any changes to the CODEOWNERS file
7+
- .github/CODEOWNERS
8+
9+
jobs:
10+
validate:
11+
runs-on: self-hosted
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/codeowners-validator@7f3f5e28c6d7b8dfae5731e54ce2272ca384592f
15+
with:
16+
checks: "syntax,files,duppatterns"
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
name: Update Version On Release.md
2+
3+
on:
4+
# Triggers the workflow on release push tag
5+
push:
6+
tags:
7+
- 'r*.*.*'
8+
branches:
9+
- '!master'
10+
11+
permissions:
12+
actions : write
13+
checks : write
14+
contents : write
15+
deployments : write
16+
issues : write
17+
packages : write
18+
pull-requests : write
19+
repository-projects : write
20+
security-events : write
21+
statuses : write
22+
23+
jobs:
24+
update_and_push:
25+
runs-on: [ self-hosted, linux ]
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
with:
30+
ref: ${{ github.head_ref }}
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set Git Config
34+
run: |
35+
git config --global user.name 'DT Platform Datavis CI'
36+
git config --global user.email 'dt-platform-datavis-ci-noreply@unity3d.com'
37+
git remote set-url origin https://github:${{ secrets.GITHUB_TOKEN }}@github.cds.internal.unity3d.com/${{ github.repository }}
38+
39+
- name: Get current date
40+
id: date
41+
run: |
42+
echo "::set-output name=date::$(date +'%Y-%m-%d')"
43+
echo DATE = $(date +'%Y-%m-%d')
44+
45+
- name: Tag Match
46+
id: tag-match
47+
shell: bash
48+
run: |
49+
if [[ ${{ github.event.ref }} =~ ^refs\/tags\/([rR](elease)?[\.-]?([0-9]+\.[0-9]+\.[0-9]+(-.*\.[0-9])))$ ]]; then
50+
echo ::set-output name=tag::${BASH_REMATCH[1]}
51+
echo ::set-output name=version::${BASH_REMATCH[3]}
52+
echo TAG = ${BASH_REMATCH[1]}
53+
echo VERSION = ${BASH_REMATCH[3]}
54+
echo ::set-output name=rc::rc-${BASH_REMATCH[3]}
55+
git tag -l | xargs git tag -d
56+
git fetch --tags
57+
echo ::set-output name=origin::$(git tag -l rc-${BASH_REMATCH[3]})
58+
fi
59+
60+
- name: Validate Tag
61+
if: ${{ (steps.tag-match.outputs.tag != '') && (steps.tag-match.outputs.origin != '') }}
62+
run: |
63+
echo A tag named ${{ steps.tag-match.outputs.rc }} already exist. Increment the version to fix this.
64+
git push --delete origin ${{ steps.tag-match.outputs.tag }}
65+
exit 1
66+
67+
- name: Branch Name Is Develop
68+
id: get-branch-dev
69+
if: ${{ steps.tag-match.outputs.tag != '' }}
70+
run: |
71+
git fetch
72+
echo ::set-output name=branch::$( git branch --contains ${{ steps.tag-match.outputs.tag }} -r | grep --only-matching --max-count 1 --extended-regex '^.*origin/develop.*$')
73+
74+
- name: Branch Name Is Other
75+
id: get-branch-other
76+
if: ${{ (steps.tag-match.outputs.tag != '') && (steps.get-branch-dev.outputs.branch == '') }}
77+
run: |
78+
echo ::set-output name=branch::$( git branch --contains ${{ steps.tag-match.outputs.tag }} -r | grep --only-matching --max-count 1 --extended-regex 'origin\/[^ H]+' | sed -E 's/.*origin\/([^ ]+).*/\1/')
79+
80+
- name: Get Branch Name
81+
id: get-branch
82+
if: ${{ steps.tag-match.outputs.tag != '' }}
83+
run: |
84+
if [[ '${{ steps.get-branch-dev.outputs.branch }}' == '' ]]; then
85+
echo ::set-output name=branch::${{ steps.get-branch-other.outputs.branch }}
86+
else
87+
echo ::set-output name=branch::develop
88+
fi
89+
echo ::set-output name=changelog::changelog-${{ steps.tag-match.outputs.version }}
90+
echo ::set-output name=staging::staging-${{ steps.tag-match.outputs.version }}
91+
92+
- name: Changelog branch
93+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
94+
run: |
95+
git checkout -b ${{ steps.get-branch.outputs.changelog }}
96+
97+
- name: Checkout the current branch
98+
if: ${{ (steps.get-branch.outputs.branch != 'develop') && (steps.tag-match.outputs.tag != '') }}
99+
run: |
100+
git checkout ${{ steps.get-branch.outputs.branch }}
101+
git pull
102+
103+
- name: Update CHANGELOG.md
104+
if: ${{ steps.tag-match.outputs.tag != '' }}
105+
run: sed -i "s/\\[\\\$ReleasedVersion\\\$\\]/[\$ReleasedVersion\$]\r\n### Added\r\n### Modified\r\n### Fix\r\n\r\n## [${{ steps.tag-match.outputs.version }}] - ${{ steps.date.outputs.date }}/" CHANGELOG.md
106+
107+
- name: Commit the changes
108+
if: ${{ steps.tag-match.outputs.tag != '' }}
109+
run: |
110+
git add CHANGELOG.md
111+
git commit -m "[skip ci] Updated CHANGELOG.md for ${{ steps.tag-match.outputs.version }}"
112+
113+
- name: Push Changelog Branch
114+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
115+
run: git push -f --set-upstream origin ${{ steps.get-branch.outputs.changelog }}
116+
117+
- name: Create Changelog Pull Request
118+
id: pr-changelog
119+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
120+
run: |
121+
echo ::set-output name=number::$(curl -i \
122+
--request POST \
123+
--header 'authorization: bearer ${{ secrets.GITHUB_TOKEN }}' \
124+
--header 'content-type: application/json' \
125+
https://github.cds.internal.unity3d.com/api/v3/repos/${{ github.repository }}/pulls \
126+
--data '{"title":"CHANGELOG ${{ steps.tag-match.outputs.version }}", "body":"This PR is auto-generated by workflow/update-version-on-release", "head":"${{ steps.get-branch.outputs.changelog }}", "base":"${{ steps.get-branch.outputs.branch }}"}' \
127+
| grep -o "\"issue_url\":.*/[0-9]"".*" \
128+
| sed -E 's/.*\/([0-9]+)",.*/\1/')
129+
130+
- name: Validate Changelog Pull Request
131+
if: ${{ (steps.get-branch.outputs.branch == 'develop') && (steps.pr-changelog.outputs.number == '') }}
132+
run: |
133+
echo Invalid Pull Request Creation
134+
exit 2
135+
136+
- name: Approve the Changelog Pull Request
137+
id: approve-changelog
138+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
139+
run: |
140+
echo ::set-output name=approved::$(curl --request POST \
141+
--url https://github.cds.internal.unity3d.com/api/v3/repos/${{ github.repository }}/pulls/${{ steps.pr-changelog.outputs.number }}/reviews \
142+
--header 'authorization: bearer ${{ secrets.GIT_TOKEN_APPROVAL }}' \
143+
--header 'content-type: application/json' \
144+
--data '{"event":"APPROVE"}' \
145+
| grep -o '.*"state": *"APPROVED".*')
146+
147+
- name: Validate Changelog Pull Request State
148+
if: ${{ (steps.get-branch.outputs.branch == 'develop') && (steps.approve-changelog.outputs.approved == '') }}
149+
run: |
150+
echo Could not approve the PR
151+
exit 3
152+
153+
- name: Checkout the current branch
154+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
155+
run: |
156+
git checkout ${{ steps.get-branch.outputs.branch }}
157+
git pull
158+
159+
- name: Push the changes to develop
160+
id: push-develop
161+
if: ${{ steps.get-branch.outputs.branch == 'develop' }}
162+
run: |
163+
echo ::set-output name=success::$(curl --request PUT \
164+
--url https://github.cds.internal.unity3d.com/api/v3/repos/${{ github.repository }}/pulls/${{ steps.pr-changelog.outputs.number }}/merge \
165+
--header 'authorization: bearer ${{ secrets.GIT_TOKEN_APPROVAL }}' \
166+
--header 'content-type: application/json' \
167+
| grep -o '.*"merged": *true.*')
168+
169+
- name: Push the changes to the current branch
170+
if: ${{ (steps.tag-match.outputs.tag != '') && (steps.get-branch.outputs.branch != 'develop') }}
171+
run: git push
172+
173+
- name: Validate Push to the current branch
174+
if: ${{ (steps.get-branch.outputs.branch == 'develop') && (steps.push-develop.outputs.success == '') }}
175+
run: |
176+
echo Could not push the PR
177+
exit 4
178+
179+
- name: Go back to the original commit
180+
if: ${{ steps.tag-match.outputs.tag != '' }}
181+
run: |
182+
git pull
183+
git checkout $GITHUB_SHA
184+
185+
- name: Create a branch to merge
186+
if: ${{ steps.tag-match.outputs.tag != '' }}
187+
run: |
188+
git fetch origin
189+
git checkout -b ${{ steps.get-branch.outputs.staging }}
190+
191+
- name: Update package.json
192+
if: ${{ steps.tag-match.outputs.tag != '' }}
193+
run: >
194+
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"${{ steps.tag-match.outputs.version }}\"/g" package.json
195+
196+
- name: Update CHANGELOG.md
197+
if: ${{ steps.tag-match.outputs.tag != '' }}
198+
run: sed -i "s/\\[\\\$ReleasedVersion\\\$\\]/[${{ steps.tag-match.outputs.version }}] - ${{ steps.date.outputs.date }}/" CHANGELOG.md
199+
200+
- name: Update All Other Files
201+
if: ${{ steps.tag-match.outputs.tag != '' }}
202+
run: find . -type f -not -path '*/\.*' -exec sed -i "s/\\\$ReleasedVersion\\\$/v${{ steps.tag-match.outputs.version }}/g" {} +
203+
204+
- name: Create Staging
205+
if: ${{ steps.tag-match.outputs.tag != '' }}
206+
run: |
207+
git add .
208+
git commit -m "[skip ci] Updated the package version to ${{ steps.tag-match.outputs.version }}"
209+
git merge --strategy=ours origin/master --allow-unrelated-histories -m "Released Candidate ${{ steps.tag-match.outputs.version }}"
210+
git push -f --set-upstream origin ${{ steps.get-branch.outputs.staging }}
211+
212+
- name: Create Master Pull Request
213+
id: pr-master
214+
if: ${{ steps.tag-match.outputs.tag != '' }}
215+
run: |
216+
echo ::set-output name=number::$(curl -i \
217+
--request POST \
218+
--header "authorization: bearer ${{ secrets.GITHUB_TOKEN }}" \
219+
--header 'content-type: application/json' \
220+
https://github.cds.internal.unity3d.com/api/v3/repos/${{ github.repository }}/pulls \
221+
--data '{"title":"Staging ${{ steps.tag-match.outputs.version }}", "body":"This PR is auto-generated by workflow/update-version-on-release", "head":"${{ steps.get-branch.outputs.staging }}", "base":"master"}' \
222+
| grep -o "\"issue_url\":.*/[0-9]"".*" \
223+
| sed -E 's/.*\/([0-9]+)",.*/\1/')
224+
225+
- name: Validate Master Pull Request
226+
if: ${{ (steps.tag-match.outputs.tag != '') && (steps.pr-master.outputs.number == '') }}
227+
run: |
228+
echo Invalid Pull Request Creation
229+
exit 5
230+
231+
- name: Approve the Master Pull Request
232+
id: approve-master
233+
if: ${{ steps.tag-match.outputs.tag != '' }}
234+
run: |
235+
echo ::set-output name=approved::$(curl --request POST \
236+
--url https://github.cds.internal.unity3d.com/api/v3/repos/${{ github.repository }}/pulls/${{ steps.pr-master.outputs.number }}/reviews \
237+
--header 'authorization: bearer ${{ secrets.GIT_TOKEN_APPROVAL }}' \
238+
--header 'content-type: application/json' \
239+
--data '{"event":"APPROVE"}' \
240+
| grep -o '.*"state": *"APPROVED".*')
241+
242+
- name: Validate Master Pull Request State
243+
if: ${{ (steps.tag-match.outputs.tag != '') && (steps.approve-master.outputs.approved == '') }}
244+
run: |
245+
echo Could not approve the PR
246+
exit 6
247+
248+
- name: Push the Changes to Master
249+
if: ${{ steps.tag-match.outputs.tag != '' }}
250+
run: |
251+
git checkout master
252+
git pull
253+
git merge ${{ steps.get-branch.outputs.staging }}
254+
git pull
255+
git push
256+
257+
- name: Update Tags
258+
if: ${{ steps.tag-match.outputs.tag != '' }}
259+
run: |
260+
git tag -a -f -m "Released Candidate ${{ steps.tag-match.outputs.version }}" ${{ steps.tag-match.outputs.rc }}
261+
git push -f origin ${{ steps.tag-match.outputs.rc }}
262+
git push --delete origin ${{ steps.tag-match.outputs.tag }}

0 commit comments

Comments
 (0)