Files
BlenderTemplate/.github/workflows/package.yml
T
2022-02-01 18:58:32 +01:00

77 lines
2.4 KiB
YAML

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_type'
NAME_PACKAGE: 'moderlab_type.zip'
# 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: python '.github/version.py' --tag=${{ inputs.num_version }} --name=${{ env.APP_NAME }}
# Get the local folder name
- name: Setup package name
run: |
echo "With python, get a folder name"
python '.github/package.py'
echo "set with output value"
echo "::set-output name=type::$(python .github/package.py)"
- 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 }}'
zip -r '${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}' ${{ env.APP_NAME }}
- 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 }}