Skip to content

Create a new Playtest branch #99

Create a new Playtest branch

Create a new Playtest branch #99

name: "Create a new Playtest branch"
on:
schedule:
- cron: '30 2 * * THU' # every Thursday at 02:30 UTC
workflow_dispatch:
inputs:
playtest-branch-manual-name:
description: 'A name for a playtest/$name branch'
required: true
jobs:
create-playtest-branch:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.WIRE_ANDROID_TEAM_WEBHOOK_URL }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive # Needed in order to fetch Kalium sources for building
fetch-depth: 0
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Manually create a named playtest branch
if: ${{ github.event.inputs.playtest-branch-manual-name }}
run: |
git checkout develop
git submodule update
git checkout -b "$PLAYTEST_BRANCH_NAME"
git push origin "$PLAYTEST_BRANCH_NAME"
gh pr create --draft --base main --title "Playtest Placeholder PR $PLAYTEST_NAME" --body "Do not merge"
env:
PLAYTEST_BRANCH_NAME: playtest/${{ github.event.inputs.playtest-branch-manual-name }}
PLAYTEST_NAME: ${{ github.event.inputs.playtest-branch-manual-name }}
- name: Notify on Wire (Manual branch)
uses: 8398a7/action-slack@v3
if: ${{ github.event.inputs.playtest-branch-manual-name }}
env:
PLAYTEST_BRANCH_NAME: playtest/${{ github.event.inputs.playtest-branch-manual-name }}
with:
status: ${{ job.status }}
text: "PLAYTEST BRANCH CREATED **${{env.PLAYTEST_BRANCH_NAME}}** πŸš€ - Hotfixes only"
- name: Automatically Create a named playtest branch
if: "${{ github.event.inputs.playtest-branch-manual-name == '' }}"
run: |
git checkout develop
git submodule update
git checkout -b "$PLAYTEST_BRANCH_NAME"
git push origin "$PLAYTEST_BRANCH_NAME"
gh pr create --draft --base main --title "Playtest Placeholder PR ${{ steps.date.outputs.date }}" --body "Do not merge"
env:
PLAYTEST_BRANCH_NAME: playtest/${{ steps.date.outputs.date }}
- name: Notify on Wire (Automatic Branch)
uses: 8398a7/action-slack@v3
if: "${{ github.event.inputs.playtest-branch-manual-name == '' }}"
env:
PLAYTEST_BRANCH_NAME: playtest/${{ steps.date.outputs.date }}
with:
status: ${{ job.status }}
text: "Playtest branch **$PLAYTEST_BRANCH_NAME** created πŸš€ - Hotfixes only on this branch"