This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cd): add tag and release note script
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release CD | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # push to version tags trigger the build | ||
|
||
#on: | ||
# push: | ||
# branches-ignore: | ||
# - '**' # temporally disable this action | ||
|
||
jobs: | ||
update-doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Manual Docs Build | ||
token: ${{ secrets.JINA_DEV_BOT }} | ||
inputs: '{ "release_token": "${{ env.release_token }}", "triggered_by": "TAG"}' | ||
env: | ||
release_token: ${{ secrets.FINETUNER_RELEASE_TOKEN }} | ||
|
||
create-release: | ||
needs: update-doc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'main' | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- run: | | ||
python scripts/get-last-release-note.py | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: 💫 Patch ${{ github.ref }} | ||
body_path: 'tmp.md' | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## under jina root dir | ||
# python scripts/get-last-release-note.py | ||
## result in root/tmp.md | ||
|
||
with open('CHANGELOG.md') as fp: | ||
n = [] | ||
for v in fp: | ||
if v.startswith('## Release Note'): | ||
n.clear() | ||
n.append(v) | ||
|
||
with open('tmp.md', 'w') as fp: | ||
fp.writelines(n) |