Get the folder name with another way

This commit is contained in:
Aurelien Vaillant
2022-02-02 12:26:36 +01:00
parent 9cb2640eb6
commit f2062b2d5b
+11 -17
View File
@@ -20,10 +20,6 @@ on:
required: true
default: 'false'
env:
APP_NAME: 'addon_name'
NAME_PACKAGE: 'addon_name.zip'
# Execute this command
jobs:
@@ -38,20 +34,18 @@ jobs:
with:
python-version: 3.8
# Update the bl info version, update the init file and push if needed
- name: Change version number in the bl info addon data
run: python '.github/version.py' --tag=${{ inputs.num_version }} --name=${{ env.APP_NAME }}
# Get the local folder name
- name: Setup package name
id: folder
run: |
echo "With python, get a folder name"
echo "Default env variable ${{env.APP_NAME}}"
python '.github/package.py'
echo "::set-output name=APP_NAME::$(echo python '.github/package.py')"
echo "show env variable app name ${{env.APP_NAME}}"
echo "::set-output name=changelog::$(echo python '.github/package.py'.zip)"
echo "show env variable package ${{env.NAME_PACKAGE}}"
echo "::set-output name=folder::$(echo python '.github/package.py')"
echo "::set-output name=package::$(echo python '.github/package.py'.zip)"
# Update the bl info version, update the init file and push if needed
- name: Change version number in the bl info addon data
run: python '.github/version.py' --tag=${{ inputs.num_version }} --name=${{ steps.folder.outputs.folder }}
- name: Commit the previous update
uses: actions-js/push@v1.3
@@ -68,18 +62,18 @@ jobs:
- name: Create zip archive release
run: |
cd '${{ github.workspace }}'
zip -r '${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}' ${{ env.APP_NAME }}
zip -r '${{ github.workspace }}/releases/${{ steps.folder.outputs.package }}' ${{ steps.folder.outputs.folder }}
- uses: actions/upload-artifact@v2
with:
name: ${{ env.NAME_PACKAGE }}
path: ${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}
name: ${{ steps.folder.outputs.package }}
path: ${{ github.workspace }}/releases/${{ steps.folder.outputs.package }}
- name: Update the github release
if: github.event_name == 'pull_request'
uses: johnwbyrd/update-release@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: '${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}'
files: '${{ github.workspace }}/releases/${{ steps.folder.outputs.package }}'
release: ${{ inputs.name_version }}
tag: ${{ inputs.name_version }}