-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add release.yaml and update pypi
- Loading branch information
Showing
5 changed files
with
82 additions
and
13 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
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,69 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
|
||
steps: | ||
# 此步骤使用 GitHub 的 https://github.com/actions/checkout | ||
- uses: actions/checkout@v3 | ||
|
||
# 设置python环境 | ||
# 此步骤使用 GitHub 的 https://github.com/actions/setup-python | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Build Assets | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
python setup.py sdist bdist_wheel | ||
ls -lh | ||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
with: | ||
# Optionally strip `v` prefix | ||
strip_v: true | ||
|
||
# - name: conventional changelog action | ||
# id: changelog | ||
# # https://github.com/TriPSs/conventional-changelog-action | ||
# uses: TriPSs/conventional-changelog-action@latest | ||
# with: | ||
# # you can also create separate token to trace action | ||
# github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
# body: ${{steps.changelog.outputs.clean_changelog}} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload assets | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dist/${{ github.event.repository.name }}-${{steps.tag.outputs.tag}}-py3-none-any.whl | ||
asset_name: ${{ github.event.repository.name }}-${{steps.tag.outputs.tag}}-py3-none-any.whl | ||
asset_content_type: application/zip |
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
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
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