Skip to content

Prepare Release

Prepare Release #50

name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: Use this to provide a version, instead of deriving it from the changelog.
required: false
type: string
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Read Core version
id: get-core-version
run: |
cd wrappers/realm-core
pkgVersion=$(grep "\bVERSION=" dependencies.list | cut -d= -f2)
echo "core-version=$pkgVersion" >> $GITHUB_OUTPUT
shell: bash
- name: Update Analytics.cs
uses: jacobtomlinson/gha-find-replace@0dfd0777cc234ef6947ec1f20873c632114c4167 #! 0.1.4
with:
find: 'CoreVersion = "\w*"'
replace: 'CoreVersion = "${{ steps.get-core-version.outputs.core-version }}"'
include: Realm/Realm.Weaver/Analytics/Analytics.cs
- name: Update Changelog
id: update-changelog
uses: realm/ci-actions/update-changelog@fa20eb972b9f018654fdb4e2c7afb52b0532f907
with:
changelog: ${{ github.workspace }}/CHANGELOG.md
version: ${{ inputs.version }}
- name: Update package.json
uses: jacobtomlinson/gha-find-replace@0dfd0777cc234ef6947ec1f20873c632114c4167 #! 0.1.4
with:
find: '"version": "[^"]*"'
replace: '"version": "${{ steps.update-changelog.outputs.new-version }}"'
include: Realm/Realm.Unity/package.json
- name: Update AssemblyInfo.props
uses: jacobtomlinson/gha-find-replace@0dfd0777cc234ef6947ec1f20873c632114c4167 #! 0.1.4
with:
find: '<VersionPrefix>[^<]*<\/VersionPrefix>'
replace: '<VersionPrefix>${{ steps.update-changelog.outputs.new-version }}</VersionPrefix>'
include: Realm/AssemblyInfo.props
- name: Create Release PR
uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad #! 3.10.1
with:
branch: release/${{ steps.update-changelog.outputs.new-version }}
title: Prepare for ${{ steps.update-changelog.outputs.new-version }}
draft: false
body: An automated PR for next release.
commit-message: Prepare for ${{ steps.update-changelog.outputs.new-version }}
token: ${{ secrets.REALM_CI_PAT }}