From a42e4ea3892c9b6d48ff77afa8b978bbdd7fb0a2 Mon Sep 17 00:00:00 2001 From: Craig Smith <952595+phpsa@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:19:37 +1200 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c25e4ac..a3401fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,14 @@ -name: Semantic Release +name: Release -on: [workflow_dispatch] +on: + push: + branches: + - master + - main + - next + - next-major + - alpha + - beta jobs: release: @@ -11,7 +19,7 @@ jobs: uses: actions/checkout@v3 - name: Semantic Release - uses: cycjimmy/semantic-release-action@v3 + uses: ./ id: semantic with: branches: | @@ -31,10 +39,16 @@ jobs: } ] extra_plugins: | - @semantic-release/commit-analyzer @semantic-release/git @semantic-release/changelog - @semantic-release/exec env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEMANTIC_RELEASE_PACKAGE: Laravel Addressable + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + + + - name: Push updates to branch for major version + if: steps.semantic.outputs.new_release_published == 'true' + run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}