Update python-publish.yml

This commit is contained in:
Aaron Heise 2023-02-12 00:42:29 -06:00 committed by GitHub
parent 5a6b8ec069
commit 0f880b7c88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,13 +64,15 @@ jobs:
id: set_version id: set_version
with: with:
script: | script: |
const tag = context.ref.substring(18) echo "version=${GITHUB_REF_NAME#*v}" >> $GITHUB_OUTPUT
const no_v = tag.replace('v', '')
const dash_index = no_v.lastIndexOf('-') # const tag = context.ref.substring(18)
const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v # const no_v = tag.replace('v', '')
core.setOutput('tag', tag) # const dash_index = no_v.lastIndexOf('-')
core.setOutput('no-v', no_v) # const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
core.setOutput('no-dash', no_dash) # core.setOutput('tag', tag)
# core.setOutput('no-v', no_v)
# core.setOutput('no-dash', no_dash)
# - name: Upload a Build Artifact # - name: Upload a Build Artifact
@ -87,7 +89,7 @@ jobs:
id: create_release id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ github.ref }} tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }} release_name: Release ${{ github.ref }}
@ -100,8 +102,8 @@ jobs:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/rnsh-${{ steps.set_version.outputs.no-v }}-py3-none-any.whl asset_path: ./dist/rnsh-${{ steps.set_version.outputs.version }}-py3-none-any.whl
asset_name: rnsh-${{ steps.set_version.outputs.no-v }}-py3-none-any.whl asset_name: rnsh-${{ steps.set_version.outputs.version }}-py3-none-any.whl
asset_content_type: application/zip asset_content_type: application/zip