Skip to content

Commit

Permalink
Use GHA cli to create release
Browse files Browse the repository at this point in the history
The github_public action is depricated and unsupported. Replace it
with the CLI.
  • Loading branch information
blowekamp committed Dec 20, 2023
1 parent d539b3f commit 44f1928
Showing 1 changed file with 8 additions and 38 deletions.
46 changes: 8 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
python -m pip install build twine
- name: Build package
run: |
python -m build --wheel
python -m build --wheel --sdist
python -m twine check dist/*
ls -la dist
- name: Upload package
Expand Down Expand Up @@ -147,49 +147,19 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install twine
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
id: download
with:
name: python-packages
- name: Extract Python Packages
id: files
run: |
cd ${{steps.download.outputs.download-path}}
echo ::set-output name=file1::$(ls *any.whl)
echo ::set-output name=file2::$(ls *.tar.gz)
- name: Create Release
- name: Create Release and Upload
if: startsWith(github.ref, 'refs/tags/v')
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
# an `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 }}/rap_sitkcore*
- name: bcbb-pypi upload
run: |
python -m twine check ${{steps.download.outputs.download-path}}/*
Expand Down

0 comments on commit 44f1928

Please sign in to comment.