name: Package Blender Plugin # How to start the Github Action on: workflow_call: inputs: num_version: description: 'Get the desired number version' type: string required: true default: '0.0.0' name_version: description: 'The release name used' type: string required: true default: 'v0.0.0' draft_version: description: 'Info about the release, publish or a draft' type: string required: true default: 'false' env: APP_NAME: 'moderlab_addon' NAME_PACKAGE: 'moderlab_addon.zip' PATH_RELEASE: ${{ github.workspace }}\releases # Execute this command jobs: make-archive: name: Make Addon Package runs-on: ubuntu-latest steps: - uses: actions/checkout@main # Update the bl info version, update the init file and push if needed - name: Change version number in the bl info addon data run: | echo 'Debug this data : "${{ inputs.draft_version }}"' python '.github/version.py' --tag=${{ inputs.num_version }} --name=${{ env.APP_NAME }} - name: Commit the previous update uses: actions-js/push@v1.3 if: ${{ inputs.draft_version == false }} with: github_token: ${{secrets.GITHUB_TOKEN}} author_name: Moderlab author_email: a.vaillant.moderlab@gmail.com message: '[Bot] Bump to ${{ inputs.num_version }} version.' branch: develop force: true # Make an archive with the plugin source only - name: Create zip archive release run: | cd '${{ github.workspace }}/${{ env.APP_NAME }}' zip -r '${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}' * - uses: actions/upload-artifact@v2 with: name: ${{ env.NAME_PACKAGE }} path: ${{ github.workspace }}/releases/${{ env.NAME_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 }}' release: ${{ inputs.name_version }} tag: ${{ inputs.name_version }}