79 lines
2.6 KiB
YAML
79 lines
2.6 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'
|
|
|
|
|
|
# Execute this command
|
|
jobs:
|
|
make-archive:
|
|
name: Make Addon Package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
|
|
- name: "Set up python"
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
|
|
# Get the local folder name
|
|
- name: Setup package name
|
|
id: folder
|
|
run: |
|
|
echo "With python, get a folder name"
|
|
python '.github/package.py'
|
|
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
|
|
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/${{ steps.folder.outputs.package }}' ${{ steps.folder.outputs.folder }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
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/${{ steps.folder.outputs.package }}'
|
|
release: ${{ inputs.name_version }}
|
|
tag: ${{ inputs.name_version }} |