1# This workflow is triggered manually and prepares a new release by creating a pull request 2# All needed info is provided by the user in the workflow_dispatch dialog 3# 4# When the pull request is merged, the release-build workflow will be triggered automatically 5 6name: "Release: Preparation " 7on: 8 workflow_dispatch: 9 inputs: 10 type: 11 description: 'What type of release is this?' 12 required: true 13 default: 'stable' 14 type: choice 15 options: 16 - stable 17 - hotfix 18 - rc 19 codename: 20 description: 'The codename for this release, empty for same as last' 21 required: false 22 version: 23 description: 'The version date YYYY-MM-DD, empty for today' 24 required: false 25 26jobs: 27 create: 28 name: Prepare Pull Request 29 runs-on: ubuntu-latest 30 steps: 31 - name: Fail if branch is not master 32 if: github.ref != 'refs/heads/master' 33 run: | 34 echo "::error::This workflow should only be triggered on master" 35 exit 1 36 37 - name: Checkout 38 uses: actions/checkout@v3 39 with: 40 fetch-depth: 0 41 42 - name: Set git identity 43 run: | 44 git config --global user.name "${{ github.actor }}" 45 git config --global user.email "${{ github.actor }}@users.noreply.github.com" 46 47 - name: Prepare Environment 48 run: | 49 php .github/release.php new \ 50 --date "${{ inputs.version }}" \ 51 --name "${{ inputs.codename }}" \ 52 --type "${{ inputs.type }}" \ 53 >> $GITHUB_ENV 54 55 - name: Check if a tag of the new release already exists 56 run: | 57 if git rev-parse "release-${{ env.next_version }}" >/dev/null 2>&1; then 58 echo "::error::Tag already exists, you may need to build a hotfix instead" 59 exit 1 60 fi 61 62 - name: Create merge commit with version info 63 run: | 64 git merge -s ours origin/stable 65 echo '${{ env.next_raw }}' > VERSION 66 git add VERSION 67 git commit --amend -m 'Release preparations for ${{ env.next_raw }}' 68 git log -1 69 git log origin/stable..master --oneline 70 git checkout -B auto-${{ env.next_version }} 71 git push --set-upstream origin auto-${{ env.next_version }} 72 73 - name: Create pull request 74 uses: repo-sync/pull-request@v2 75 with: 76 source_branch: auto-${{ env.next_version }} 77 destination_branch: stable 78 pr_title: Release Preparations for ${{ env.next_raw }} 79 pr_body: | 80 With accepting this PR, a the stable branch will be updated and the whole release and 81 deployment process will be triggered. 82 83 If you're not happy with the contents of this PR, please close it, fix stuff and trigger 84 the workflow again. 85 86 * ${{ env.current_raw }} -> ${{ env.next_raw }} 87 * Update Version ${{ env.current_update }} -> ${{ env.next_update }} 88 89 Before merging this PR, make sure that: 90 91 - [ ] Ensure all tests pass 92 - [ ] If this is a new stable release, make sure you merged `stable` into `old-stable` first 93 - [ ] Check that a meaningful [changelog](https://www.dokuwiki.org/changes) exists 94 95 After merging, the release workflow will be triggered automatically. 96 97 After this is done, you need to do the following things manually: 98 99 - [ ] Update the [version symlinks](https://download.dokuwiki.org/admin/) 100 - [ ] Update the update message system 101 - [ ] Announce the release on the mailing list, forum, IRC, social media, etc. 102 103