diff --git a/.github/workflows/pr-dev-to-main.yml b/.github/workflows/pr-dev-to-main.yml new file mode 100644 index 00000000..599968a2 --- /dev/null +++ b/.github/workflows/pr-dev-to-main.yml @@ -0,0 +1,33 @@ +name: Create Pull Request from dev to main + +on: + workflow_dispatch: + +jobs: + merge: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch All + run: git fetch --all + + - name: Get Latest Tag + id: previoustag + uses: WyriHaximus/github-action-get-previous-tag@v1.4.0 + with: + fallback: v1.0.0 + + - name: Create Dev to Main Pull Request + run: | + git checkout dev + git pull + git switch -c dev-${{ steps.previoustag.outputs.tag }} + git push origin dev-${{ steps.previoustag.outputs.tag }} + gh pr create --base main --head dev-${{ steps.previoustag.outputs.tag }} --title "Merge dev at version ${{ steps.previoustag.outputs.tag }} to main" --body "This PR merges the dev branch at version ${{ steps.previoustag.outputs.tag }} to the main branch." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test-build-release.yml b/.github/workflows/test-build-release.yml index a3d24537..2f65f486 100644 --- a/.github/workflows/test-build-release.yml +++ b/.github/workflows/test-build-release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - dev jobs: test-build: diff --git a/release.config.js b/release.config.js index 3f5f5da6..854b7d0b 100644 --- a/release.config.js +++ b/release.config.js @@ -1,13 +1,14 @@ module.exports = { - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/github", - [ - "@semantic-release/exec" - ] - ], - "branches": [ - "main" + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github", + [ + "@semantic-release/exec" ] - } \ No newline at end of file + ], + "branches": [ + { name: "main" }, + { name: "dev", channel: "dev", prerelease: true } + ] +} \ No newline at end of file