Skip to content

Commit d199f2d

Browse files
authored
Merge pull request #140 from polywrap/dev
prep 0.1.0a22 | /workflows/cd
2 parents b65b786 + 7888762 commit d199f2d

File tree

3 files changed

+65
-67
lines changed

3 files changed

+65
-67
lines changed

.github/workflows/cd.yaml

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: Checkout
8585
uses: actions/checkout@v3
8686
with:
87-
fetch-depth: 0
87+
ref: ${{github.event.pull_request.base.ref}}
8888

8989
- name: Set env.BUILD_BOT to Build Bot's Username
9090
run: echo BUILD_BOT=polywrap-build-bot >> $GITHUB_ENV
@@ -125,26 +125,19 @@ jobs:
125125
env:
126126
POLYWRAP_BUILD_BOT_PYPI_PAT: ${{ secrets.POLYWRAP_BUILD_BOT_PYPI_PAT }}
127127

128-
- name: Commit Version Changes
129-
run: |
130-
git add .
131-
git commit -m "chore: patch version to ${{env.RELEASE_VERSION}}" --allow-empty
132-
continue-on-error: true
133-
134128
- name: Create Pull Request from dev to main
135129
id: cpr-cd
136130
uses: peter-evans/create-pull-request@v3
137131
with:
138132
branch: cd/${{env.RELEASE_VERSION}}
139-
base: main
140133
committer: GitHub <noreply@github.com>
141134
author: ${{env.BUILD_BOT}} <${{env.BUILD_BOT}}@users.noreply.github.com>
142135
commit-message: "chore: patch version to ${{env.RELEASE_VERSION}}"
143136
title: 'Python client CD (${{env.RELEASE_VERSION}})'
144137
body: |
145138
## Python client CD (${{env.RELEASE_VERSION}})
146139
147-
- name: Release PR Created...
140+
- name: CD PR Created...
148141
uses: actions/github-script@0.8.0
149142
with:
150143
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -156,62 +149,6 @@ jobs:
156149
body: '**[Release PR Created](https://github.com/${{github.repository}}/pull/${{ steps.cpr-cd.outputs.pull-request-number }}) (`${{env.RELEASE_VERSION}}`)**'
157150
})
158151
159-
- name: Building POST CD PR...
160-
uses: actions/github-script@0.8.0
161-
with:
162-
github-token: ${{secrets.GITHUB_TOKEN}}
163-
script: |
164-
github.issues.createComment({
165-
issue_number: context.issue.number,
166-
owner: context.repo.owner,
167-
repo: context.repo.repo,
168-
body: '[Building POST CD PR](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) (`${{env.RELEASE_VERSION}}`)'
169-
})
170-
171-
- name: Link Packages in dev branch
172-
run: python3 scripts/link_packages.py
173-
174-
- name: Commit Linking Changes
175-
run: |
176-
git add .
177-
git commit -m "chore: link dependencies post ${{env.RELEASE_VERSION}} release" --allow-empty
178-
continue-on-error: true
179-
180-
- name: Create Pull Request from main to dev
181-
id: cpr-post-cd
182-
uses: peter-evans/create-pull-request@v3
183-
with:
184-
branch: post-cd/${{env.RELEASE_VERSION}}
185-
base: dev
186-
committer: GitHub <noreply@github.com>
187-
author: ${{env.BUILD_BOT}} <${{env.BUILD_BOT}}@users.noreply.github.com>
188-
commit-message: "chore: link dependencies post ${{env.RELEASE_VERSION}} release"
189-
title: 'Python client POST CD (${{env.RELEASE_VERSION}})'
190-
body: |
191-
## Python client POST CD (${{env.RELEASE_VERSION}})
192-
193-
- name: POST CD PR Created...
194-
uses: actions/github-script@0.8.0
195-
with:
196-
github-token: ${{secrets.GITHUB_TOKEN}}
197-
script: |
198-
github.issues.createComment({
199-
issue_number: context.issue.number,
200-
owner: context.repo.owner,
201-
repo: context.repo.repo,
202-
body: '**[POST CD PR Created](https://github.com/${{github.repository}}/pull/${{ steps.cpr-post-cd.outputs.pull-request-number }}) (`${{env.RELEASE_VERSION}}`)**'
203-
})
204-
205-
Github-release:
206-
needs:
207-
- Pre-Check
208-
name: Create Release
209-
runs-on: ubuntu-latest
210-
steps:
211-
- name: Checkout code
212-
uses: actions/checkout@v3
213-
- name: Read VERSION into env.RELEASE_VERSION
214-
run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV
215152
- id: changelog
216153
name: "Generate release changelog"
217154
uses: heinrichreimer/github-changelog-generator-action@v2.3
@@ -220,7 +157,8 @@ jobs:
220157
unreleasedLabel: ${{ env.RELEASE_VERSION }}
221158
token: ${{ secrets.GITHUB_TOKEN }}
222159
continue-on-error: true
223-
- name: Create Release
160+
161+
- name: Create GitHub Release
224162
id: create_release
225163
uses: actions/create-release@v1
226164
env:

.github/workflows/post-cd.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CD
2+
on:
3+
# When Pull Request is merged
4+
pull_request_target:
5+
types: [closed]
6+
7+
jobs:
8+
Dev-PR:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
ref: dev
15+
fetch-depth: 0
16+
17+
- name: Set Git Identity
18+
run: |
19+
git config --global user.name '${{env.BUILD_BOT}}'
20+
git config --global user.email '${{env.BUILD_BOT}}@users.noreply.github.com'
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.POLYWRAP_BUILD_BOT_PAT }}
23+
24+
- name: Merge main into dev
25+
run: git merge origin/main
26+
27+
- name: set env.RELEASE_FORKS to Release Forks' Organization
28+
run: echo RELEASE_FORKS=polywrap-release-forks >> $GITHUB_ENV
29+
30+
- name: Set env.BUILD_BOT to Build Bot's Username
31+
run: echo BUILD_BOT=polywrap-build-bot >> $GITHUB_ENV
32+
33+
- name: Read VERSION into env.RELEASE_VERSION
34+
run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV
35+
36+
- name: Set up Python 3.10
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: "3.10"
40+
41+
- name: Install poetry
42+
run: curl -sSL https://install.python-poetry.org | python3 -
43+
44+
- name: Install tomlkit
45+
run: pip3 install tomlkit
46+
47+
- name: Link Packages in dev branch
48+
run: python3 scripts/link_packages.py
49+
50+
- name: Create Pull Request from main to dev
51+
id: cpr-post-cd
52+
uses: peter-evans/create-pull-request@v3
53+
with:
54+
branch: post-cd/${{env.RELEASE_VERSION}}
55+
committer: GitHub <noreply@github.com>
56+
author: ${{env.BUILD_BOT}} <${{env.BUILD_BOT}}@users.noreply.github.com>
57+
commit-message: "chore: link dependencies post ${{env.RELEASE_VERSION}} release"
58+
title: 'Python client POST CD (${{env.RELEASE_VERSION}})'
59+
body: |
60+
## Python client POST CD (${{env.RELEASE_VERSION}})

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0a21
1+
0.1.0a22

0 commit comments

Comments
 (0)