Skip to content

Commit

Permalink
Use gh command line to create and upload to GitHub release
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Jul 21, 2023
1 parent b03ca16 commit c732374
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run: |
python -m build
python -m pip install twine build
python -m build --wheel --sdist
python -m twine check dist/*
ls -la dist
- name: Upload package
if: github.event_name == 'push'
Expand All @@ -127,41 +125,14 @@ jobs:
id: files
run: |
cd ${{steps.download.outputs.download-path}}
echo ::set-output name=file1::$(ls tbpcxr*any.whl)
echo ::set-output name=file2::$(ls tbpcxr*.tar.gz)
- name: Create Release
- name: Create Release and Upload
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset Wheel
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include
# a `upload_url`. See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.download.outputs.download-path}}/${{steps.files.outputs.file1}}
asset_name: ${{steps.files.outputs.file1}}
asset_content_type: application/octet-stream
- name: Upload Release Asset Source
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.download.outputs.download-path}}/${{steps.files.outputs.file2}}
asset_name: ${{steps.files.outputs.file2}}
asset_content_type: application/octet-stream
run: |
gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --verify-tag --generate-notes --title "Release ${{ github.ref_name }}"
gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} ${{steps.download.outputs.download-path}}
- name: bcbb-pypi upload
run: |
python -m pip install twine
Expand Down

0 comments on commit c732374

Please sign in to comment.