From 5ad84ee7ca1e1434f83c6941ae7642e88aa77530 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Thu, 25 Jan 2024 21:28:13 +0100 Subject: [PATCH] Update simple-release.yml --- .github/workflows/simple-release.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/simple-release.yml b/.github/workflows/simple-release.yml index 76b0462..7f38302 100644 --- a/.github/workflows/simple-release.yml +++ b/.github/workflows/simple-release.yml @@ -19,6 +19,10 @@ on: type: string description: If the value is true then it builds web files, if not then it is a simple release. required: false + neededNewBranch: + type: string + description: Specify true or false if you want to create a new branch. + required: false jobs: create-release: name: Build and Create Tagged release @@ -38,7 +42,7 @@ jobs: run: sudo apt install zip - name: Checkout source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 ref: ${{ github.head_ref }} @@ -47,13 +51,13 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 17 + node-version: 20 - name: Setup node with dependency path if: ${{ env.WEB }} uses: actions/setup-node@v3 with: - node-version: 17 + node-version: 20 cache: 'npm' cache-dependency-path: web/package-lock.json @@ -74,16 +78,19 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@v1" with: fallback: 1.0.0 + - name: Get next minor version id: semvers uses: "WyriHaximus/github-action-next-semvers@v1" with: version: ${{ steps.previoustag.outputs.tag }} + - name: Create new milestone id: createmilestone uses: "WyriHaximus/github-action-create-milestone@v1" with: title: ${{ steps.semvers.outputs.patch }} + - name: Set Release Version id: set_version run: | @@ -92,6 +99,15 @@ jobs: else echo "DETERMINED_VERSION=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV fi + + - name: Set needed new branch + run: | + if [ "${{ inputs.neededNewBranch }}" = "true" ]; then + echo "NEW_BRANCH_NEEDED=new-release-${{ env.DETERMINED_VERSION }}" >> $GITHUB_ENV + else + echo "NEW_BRANCH_NEEDED=" >> $GITHUB_ENV + fi + - name: 'Download Bump manifest version js file and run in node' run: curl -f https://raw.githubusercontent.com/esx-framework/.github/main/.github/actions/bump-manifest-version.js | node - env: @@ -99,11 +115,12 @@ jobs: - name: Push manifest change uses: EndBug/add-and-commit@v8 with: - add: fxmanifest.lua + add: ${{ env.FXMANIFEST_FILE_CHANGES }} push: true author_name: Manifest Bumper author_email: 41898282+github-actions[bot]@users.noreply.github.com message: 'chore: bump manifest version to ${{ env.DETERMINED_VERSION }}' + new_branch: ${{ env.NEW_BRANCH_NEEDED }} - name: Update tag ref uses: EndBug/latest-tag@latest