GH Action to populate build stage yaml files (stable only for now) #8
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
# Copyright (c) Microsoft Corporation. | |
# Licensed under the MIT license. | |
name: Update Channel Based ReleaseStage Yaml Files | |
permissions: | |
contents: read | |
on: | |
workflow_dispatch: | |
inputs: | |
stableReleaseTag: | |
description: 'release tag for stable' | |
required: true | |
pull_request: | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
update-yaml-stable: | |
name: Update ReleaseStageYaml for Stable Channel | |
timeout-minutes: 15 | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Validate Version Syntax | |
run: | | |
$stableValue = '${{ inputs.stableReleaseTag }}' | |
if ($stableValue -notmatch '^v\d+\.\d+\.\d+$') { | |
throw "stable release tag is not for a stable build: '$stableValue'" | |
} | |
- name: Update ReleaseStageYaml file | |
run: | | |
$toolsFolderPath = Join-Path -Path ${{ github.workspace }} -ChildPath 'tools' | |
$buildHelperFolderPath = Join-Path -Path $toolsFolderPath -ChildPath 'buildHelper' | |
$buildHelperModulePath = Join-Path -Path $buildHelperFolderPath -ChildPath 'buildHelper.psm1' | |
Import-Module $buildHelperModulePath | |
./build.ps1 -GenerateMatrixJson -Channel stable -Verbose -Acr All -OsFilter All | |
- name: View Updated Files Content | |
run: | | |
$ciFolderPath = Join-Path -Path ${{ github.workspace }} -ChildPath '.vsts-ci' | |
$releaseStageFilePath = Join-Path -Path $ciFolderPath -ChildPath 'stableReleaseStage.yml' | |
- name: Create Pull Request | |
if: github.event_name == 'workflow_dispatch' | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: "${{ secrets.PR_PAT }}" | |
commit-message: "Update the stableReleaseStage yaml file" | |
committer: PwshBot <[email protected]> | |
author: PwshBot <[email protected]> | |
title: "Update the stableReleaseStage json" | |
base: master | |
draft: false | |
branch: update-build-yaml-files | |
push-to-fork: pwshBot/PowerShell-Docker |