Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
chore(cd): add tag and release note script
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Oct 19, 2021
1 parent 33b1c90 commit 370e5fb
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/tag.yml
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
13 changes: 13 additions & 0 deletions scripts/get-last-release-note.py
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)

0 comments on commit 370e5fb

Please sign in to comment.