Release start #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: Release start | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
release_version_name: | |
description: 'New release version name' | |
required: true | |
type: string | |
development_version_name: | |
description: 'Development version name' | |
required: true | |
type: string | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
create_branch: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
env: | |
RELEASE_VERSION: ${{ inputs.release_version_name }} | |
RELEASE_BRANCH: 'release/${{ inputs.release_version_name }}' | |
steps: | |
- id: debug | |
name: Print environment variables and event payload | |
uses: hmarr/[email protected] | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.1 | |
# override vName with new version | |
- name: Create release branch | |
run: | | |
git checkout -b ${{ env.RELEASE_BRANCH }} | |
git push origin ${{ env.RELEASE_BRANCH }} | |
- name: Run Python script to update release branch version | |
run: python scripts/updateVersionName.py ${{ env.RELEASE_VERSION }} | |
- name: Commit and Push Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'Update version to ${{ env.RELEASE_VERSION }}' | |
update_version: | |
if: false | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
env: | |
DEVELOPMENT_VERSION: ${{ inputs.development_version_name }} | |
DEVELOPMENT_BRANCH: 'update_version_to${{ inputs.development_version_name }}' | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12.1 | |
- name: Create release branch | |
run: | | |
git checkout -b ${{ env.DEVELOPMENT_BRANCH }} | |
git push origin ${{ env.DEVELOPMENT_BRANCH }} | |
- name: Run Python script to update base branch version | |
run: python scripts/updateVersionName.py ${{ env.DEVELOPMENT_VERSION }} | |
- name: Commit and Push Changes | |
uses: flex-development/[email protected] | |
with: | |
message: 'Update version to ${{ env.DEVELOPMENT_VERSION }}' | |
ref: ${{ env.DEVELOPMENT_BRANCH }} | |
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | |
- name: create pull request | |
run: gh pr create -B develop -H update_version_to${{ env.DEVELOPMENT_VERSION }} --title 'Merge ${{ env.DEVELOPMENT_BRANCH }} into develop' --body 'Created by Github action' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |