Skip to content

Commit

Permalink
[automation]: Use github cli to upload release assets (#3691)
Browse files Browse the repository at this point in the history
* [automation]: Use github cli to upload release assets

* Checkout the repo before tag the version

* Update release drafter step id

(cherry picked from commit 567c177)
  • Loading branch information
haiiliin authored and mergify[bot] committed Nov 29, 2022
1 parent cb4d5b4 commit e17fda7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
pip install build
- name: Build package
run: python -m build
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: ./dist/abqpy-*
file_glob: true
overwrite: true
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,33 @@ jobs:
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Substring version
uses: bhowell2/github-substring-action@v1.0.0
id: tag
with:
value: ${{ steps.release_drafter.outputs.tag_name }}
index_of_str: "v"
- name: Tag the next version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag -a ${{ steps.release_drafter.outputs.tag_name }} -m "Release ${{ steps.release_drafter.outputs.tag_name }}"
- name: Build package
run: python -m build
- name: Upload binaries to release
run: |
gh release upload --clobber ${{ env.VERSION }} ${{ env.FILES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.release_drafter.outputs.tag_name }}
FILES: dist/abqpy-${{ steps.tag.outputs.substring }}.tar.gz dist/abqpy-${{ steps.tag.outputs.substring }}-py3-none-any.whl

0 comments on commit e17fda7

Please sign in to comment.