Skip to content

Push beta branch

Push beta branch #291

Workflow file for this run

name: Push beta branch
on:
schedule:
- cron: '0 0 * * 5'
push:
branches:
- 'master'
workflow_dispatch:
jobs:
push-beta:
runs-on: ubuntu-22.04
steps:
- name: Set line endings
run: git config --global core.autocrlf true
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'dev'
fetch-depth: 0
- name: Configure bot user
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Generate Release notes
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
# Delete existing beta draft if it exists
if gh release view beta >/dev/null 2>&1; then
gh release delete beta --yes
fi
# Create new beta draft release with generated notes
# Make sure the latest tag is correct, even if the current commit is already tagged
LATEST_TAG=$(git describe --tags --abbrev=0)
gh release create beta --title "Beta Release" --draft --generate-notes --notes-start-tag "$LATEST_TAG"
gh release view beta > temp_change.md
- name: Tweak changelogs
id: tweak-changelogs
continue-on-error: true
run: |
# Remove carriage returns to be able to run the script
sed -i 's/\r$//' .github/tweak_changelogs.sh
chmod +x .github/tweak_changelogs.sh
.github/tweak_changelogs.sh beta
# The hash suffix will help identifying if the beta version is up-to-date
- name: Add commit hash suffix to manifest version
if: steps.tweak-changelogs.outcome == 'success'
run: |
sed -i "s/<Version number=\"\([^\"]*\)\"/<Version number=\"\1-$(git rev-parse --short HEAD)\"/g" manifest.xml
- name: Update manifest.xml
run: python3 update_manifest.py --quiet --in-place
- name: Push to beta branch
run: |
git commit -am "Weekly beta release" --allow-empty --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
git push origin HEAD:beta --force