generated from stilobique/BlenderTemplate
Initial commit
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
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: Setup package variable
|
||||
id: folder
|
||||
run: |
|
||||
echo "::set-output name=folder::$(python '.github/package.py')"
|
||||
echo "::set-output name=package::$(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: ${{ github.event.action }} == 'opened'
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
author_name: Moderlab
|
||||
author_email: a.vaillant@moderlab.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.folder }}
|
||||
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 }}
|
||||
Reference in New Issue
Block a user