diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index dd3e2de..8a0766d 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -5,12 +5,13 @@ on: branches-ignore: [main, develop] + jobs: unit-test: - uses: Moderlab-Production/BlenderObjectType/.github/workflows/unit_test.yml@develop + uses: Moderlab-Production/BlenderTemplate/.github/workflows/unit_test.yml@main generate-package: - uses: Moderlab-Production/BlenderObjectType/.github/workflows/package.yml@develop + uses: Moderlab-Production/BlenderTemplate/.github/workflows/package.yml@main with: num_version: '0.0.0' name_version: 'v0.0.0' \ No newline at end of file diff --git a/.github/workflows/init_release.yml b/.github/workflows/init_release.yml index 6b6791c..e6a4398 100644 --- a/.github/workflows/init_release.yml +++ b/.github/workflows/init_release.yml @@ -7,6 +7,7 @@ on: types: [opened] + jobs: create-release: name: Create a new release @@ -38,4 +39,10 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} prerelease: true - tag: 'v${{ steps.semantic_setup.outputs.version }}' \ No newline at end of file + tag: 'v${{ steps.semantic_setup.outputs.version }}' + + pull-request-ci: + name: Start all pull request CI jobs + needs: + - create-release + uses: Moderlab-Production/BlenderTemplate/.github/workflows/pr_main.yml@main \ No newline at end of file diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index fc8b985..3003abf 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -14,6 +14,11 @@ on: 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' @@ -29,17 +34,26 @@ jobs: steps: - uses: actions/checkout@main - # Update the bl info version + # 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 set this tag "${{ steps.release.outputs.tag_name }}" - python '.github/version.py' --tag=${{ inputs.num_version }} --name=${{ env.APP_NAME }} + run: 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 }}' * + cd '${{ github.workspace }}' + zip -r '${{ github.workspace }}/releases/${{ env.NAME_PACKAGE }}' ${{ env.APP_NAME }} - uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/pull_request_main.yml b/.github/workflows/pr_main.yml similarity index 91% rename from .github/workflows/pull_request_main.yml rename to .github/workflows/pr_main.yml index 707c64b..4bc179e 100644 --- a/.github/workflows/pull_request_main.yml +++ b/.github/workflows/pr_main.yml @@ -1,6 +1,7 @@ name: Create addon release on: + workflow_call: pull_request: branches: [main] @@ -36,7 +37,7 @@ jobs: id: get_semantic_setup uses: oprypin/find-latest-tag@v1.1.0 with: - repository: Moderlab-Production/BlenderObjectType + repository: ${{ github.repository }} releases-only: true prefix: 'v' token: ${{ secrets.GITHUB_TOKEN }} @@ -54,15 +55,16 @@ jobs: fi unit-test: - uses: Moderlab-Production/BlenderObjectType/.github/workflows/unit_test.yml@develop + uses: Moderlab-Production/BlenderTemplate/.github/workflows/unit_test.yml@main release-package: needs: - init-release-data - uses: Moderlab-Production/BlenderObjectType/.github/workflows/package.yml@develop + uses: Moderlab-Production/BlenderTemplate/.github/workflows/package.yml@main with: num_version: ${{ needs.init-release-data.outputs.version_number }} name_version: ${{ needs.init-release-data.outputs.version_name }} + draft_version: ${{ needs.init-release-data.outputs.version_draft }} publish-release: name: Publish the Github Release