|
| 1 | +name: Publish Release Version |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Release branch version' |
| 8 | + required: false |
| 9 | + |
| 10 | +jobs: |
| 11 | + merge-release-branch-to-develop: |
| 12 | + if: (github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'wpkitpro/') |
| 13 | + runs-on: ubuntu-20.04 |
| 14 | + steps: |
| 15 | + - name: Checkout main branch |
| 16 | + uses: actions/checkout@v2 |
| 17 | + with: |
| 18 | + token: ${{ secrets.MAINTAIN_TOKEN }} |
| 19 | + ref: main |
| 20 | + - name: Get release branch |
| 21 | + env: |
| 22 | + INPUT_VERSION: ${{ github.event.inputs.version }} |
| 23 | + run: | |
| 24 | + bash "${GITHUB_WORKSPACE}/.github/scripts/get-release-branch-name.sh" |
| 25 | + - name: Checkout release branch |
| 26 | + uses: actions/checkout@v2 |
| 27 | + with: |
| 28 | + token: ${{ secrets.MAINTAIN_TOKEN }} |
| 29 | + ref: ${{ env.RELEASE_BRANCH }} |
| 30 | + - name: Merge release -> develop |
| 31 | + uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1 |
| 32 | + with: |
| 33 | + type: now |
| 34 | + from_branch: ${{ env.RELEASE_BRANCH }} |
| 35 | + target_branch: develop |
| 36 | + github_token: ${{ secrets.MAINTAIN_TOKEN }} |
| 37 | + bump-version: |
| 38 | + needs: merge-release-branch-to-develop |
| 39 | + runs-on: ubuntu-16.04 |
| 40 | + outputs: |
| 41 | + prev_version: ${{ steps.bump_version_step.outputs.prev_version }} |
| 42 | + steps: |
| 43 | + - name: Checkout develop branch |
| 44 | + uses: actions/checkout@v2 |
| 45 | + with: |
| 46 | + token: ${{ secrets.MAINTAIN_TOKEN }} |
| 47 | + ref: develop |
| 48 | + - name: Bump version |
| 49 | + id: bump_version_step |
| 50 | + run: | |
| 51 | + npm config set git-tag-version false |
| 52 | + PREV_PACKAGE_VERSION=$(node -p "require('./package.json').version") |
| 53 | + npm version minor |
| 54 | + PACKAGE_VERSION=$(node -p "require('./package.json').version") |
| 55 | + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV |
| 56 | + echo "::set-output name=prev_version::${PREV_PACKAGE_VERSION}" |
| 57 | + - name: Update version in files |
| 58 | + env: |
| 59 | + VERSION: ${{ env.PACKAGE_VERSION }} |
| 60 | + run: | |
| 61 | + npm install --no-package-lock --no-save replace-in-file@6.2.0 |
| 62 | + node ./.github/scripts/update-version-in-files.js |
| 63 | + #npx grunt wp_readme |
| 64 | + - name: Check if readme.txt update |
0 commit comments