From 70229bafb97cbff478950779e9cf80180972a8d9 Mon Sep 17 00:00:00 2001 From: stilobique Date: Mon, 30 May 2022 14:49:46 +0200 Subject: [PATCH] Split start and other event with the github action --- .github/workflows/initialyse_data.yml | 20 --------------- .github/workflows/pr_main.yml | 2 +- .github/workflows/pr_main_start.yml | 36 +++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/pr_main_start.yml diff --git a/.github/workflows/initialyse_data.yml b/.github/workflows/initialyse_data.yml index 89dd570..a6449bd 100644 --- a/.github/workflows/initialyse_data.yml +++ b/.github/workflows/initialyse_data.yml @@ -26,17 +26,6 @@ jobs: version_draft: ${{ steps.semantic_setup.outputs.draft }} version_name: ${{ steps.semantic_setup.outputs.version }} steps: - - name: Setup bump release - id: bump_setup - run: | - if [ ${{ contains(github.event.pull_request.labels.*.name, 'release:major') }} == true ]; then - echo "::set-output name=type::major" - elif [ ${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }} == true ]; then - echo "::set-output name=type::minor" - else - echo "::set-output name=type::patch" - fi - - name: Get the Semantic tag Version id: get_semantic_setup uses: oprypin/find-latest-tag@v1.1.0 @@ -46,15 +35,6 @@ jobs: prefix: 'v' token: ${{ secrets.GITHUB_TOKEN }} - - name: Increment if a new release are needed to generated - if: ${{ github.event.action == 'opened' }} - id: new_semantic_setup - uses: zwaldowski/semver-release-action@v2 - with: - bump: ${{ steps.bump_setup.outputs.type }} - github_token: ${{ secrets.GITHUB_TOKEN }} - dry_run: true - - name: From all use case, get the Tag version id: semantic_setup run: | diff --git a/.github/workflows/pr_main.yml b/.github/workflows/pr_main.yml index 00ea4b8..7d0dc5f 100644 --- a/.github/workflows/pr_main.yml +++ b/.github/workflows/pr_main.yml @@ -5,7 +5,7 @@ on: branches: [main] types: - [opened, edited, synchronize, closed] + [edited, synchronize, closed] jobs: diff --git a/.github/workflows/pr_main_start.yml b/.github/workflows/pr_main_start.yml new file mode 100644 index 0000000..f69b105 --- /dev/null +++ b/.github/workflows/pr_main_start.yml @@ -0,0 +1,36 @@ +name: Create addon release + +on: + pull_request: + branches: + [main] + types: + [opened] + + +jobs: + init-release: + name: Generate the release + runs-on: ubuntu-latest + steps: + - name: Setup bump release + id: bump_setup + run: | + if [ ${{ contains(github.event.pull_request.labels.*.name, 'release:major') }} == true ]; then + echo "::set-output name=type::major" + elif [ ${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }} == true ]; then + echo "::set-output name=type::minor" + else + echo "::set-output name=type::patch" + fi + + - name: Increment a new release + id: new_semantic_setup + uses: zwaldowski/semver-release-action@v2 + with: + bump: ${{ steps.bump_setup.outputs.type }} + github_token: ${{ secrets.GITHUB_TOKEN }} + dry_run: true + + unit-test: + uses: Moderlab-Production/BlenderTemplate/.github/workflows/unit_test.yml@main