Skip to content

Commit

Permalink
Merge pull request #769 from unoplatform/mergify/bp/release/stable/5.…
Browse files Browse the repository at this point in the history
…3/pr-756

ci: Updater fixes for release branches (backport #756)
  • Loading branch information
jeromelaban authored Jun 21, 2024
2 parents 1531bac + 31a0676 commit 33c04b0
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 29 deletions.
26 changes: 26 additions & 0 deletions .github/actions/sdk-update/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "SDK Update"
description: "Update Uno Sdk"

runs:
using: "composite"
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.300'

- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.10.3'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
configFilePath: build/gitversion.yml

- name: Run Uno Sdk Updater
run: dotnet run -c Release --project tools/Uno.Sdk.Updater
shell: pwsh
23 changes: 23 additions & 0 deletions .github/workflows/uno-updater-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update Uno Sdk (PR)

on:
pull_request:
branches:
- main
- release/stable/*
paths:
- .github/workflows/uno-updater-pr.yml
- .github/actions/sdk-update/*
- tools/Uno.Sdk.Updater/*

jobs:
manifest-update:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Sdk Update"
uses: ./.github/actions/sdk-update
52 changes: 23 additions & 29 deletions .github/workflows/uno-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ name: Update Uno Sdk

on:
schedule:
- cron: '0 * * * *'
pull_request:
branches:
- main
- release/stable/*
paths:
- .github/workflows/uno-updater.yml
- tools/Uno.Sdk.Updater/*
- cron: '0 */6 * * *'
workflow_dispatch:
inputs:
branch:
Expand All @@ -20,41 +13,42 @@ on:
jobs:
manifest-update:
runs-on: windows-latest
strategy:
matrix:
branch:
- main
- release/stable/5.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.300'

- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.10.3'

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v1.1.1

- name: "Sdk Update"
uses: ./.github/actions/sdk-update
with:
useConfigFile: true
configFilePath: build/gitversion.yml
branch: ${{ matrix.branch }}

- name: Run Uno Sdk Updater
run: dotnet run -c Release --project tools/Uno.Sdk.Updater
- name: Set target branch
id: targetbranch
run: |
if [[ "${{ matrix.branch }}" == "main" ]]; then
echo "::set-output name=targetbranch::sdk/update/dev"
else
versionNumber=$(echo "${{ matrix.branch }}" | cut -d'/' -f 3)
echo "::set-output name=targetbranch::sdk/update/release/$versionNumber"
fi
shell: bash

- name: Create Pull Request
if: github.event_name != 'pull_request'
id: cpr
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: dev/sdk/update
branch: ${{ steps.targetbranch.outputs.targetbranch }}
commit-message: 'chore: Update Uno.Sdk'
title: Uno.Sdk Update
title: Uno.Sdk Update - ${{ matrix.branch }}
body: |
This updates the Uno.Sdk to the latest available version.
labels: sdk-update
Expand Down

0 comments on commit 33c04b0

Please sign in to comment.