Skip to content

Commit bc1aab5

Browse files
committed
New workflow
1 parent a0dc89f commit bc1aab5

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

.github/workflows/bump-controls.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright (c) Files Community
2+
# Licensed under the MIT License.
3+
4+
# Abstract:
5+
# Bumps the version of the Files UI Controls library
6+
#
7+
# Workflow:
8+
# 1. Find the version of the Files UI Controls library
9+
# 2. Bump the version of the Files UI Controls library
10+
# 3. Commit the changes to a new branch in the repo
11+
# 4. Push the changes to the repo
12+
# 5. Create a pull request and request a review
13+
14+
name: Bump Files UI Controls
15+
16+
on:
17+
workflow_dispatch:
18+
pull_request:
19+
branches: [ "main" ]
20+
21+
jobs:
22+
bump:
23+
runs-on: windows-latest
24+
strategy:
25+
fail-fast: false
26+
env:
27+
WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\
28+
PROPS_PATH: '${{ github.workspace }}\src\Files.App.Controls\CurrentVersion.props'
29+
30+
steps:
31+
- name: Checkout the repository
32+
uses: actions/checkout@v4
33+
34+
- name: Bump Version
35+
id: bump_version
36+
shell: pwsh
37+
run: |
38+
$xml = [xml](Get-Content $env:PROPS_PATH)
39+
$version = [int]$xml.Project.PropertyGroup.MicroVersion
40+
$newVersion = $version + 1
41+
$xml.Project.PropertyGroup.MicroVersion = $newVersion
42+
$xml.Save($env:PROPS_PATH)
43+
Write-Output "Bumped version to $newVersion"
44+
echo "::set-output name=new_version::$newVersion"
45+
46+
- uses: EndBug/add-and-commit@v9
47+
with:
48+
# The arguments for the `git add` command
49+
# Default: '.'
50+
add: '${{ env.PROPS_PATH }}'
51+
52+
# The name of the user that will be displayed as the author of the commit.
53+
# Default: depends on the default_author input
54+
author_name: files-community-bot[bot]
55+
56+
# The email of the user that will be displayed as the author of the commit.
57+
# Default: depends on the default_author input
58+
author_email: 152337890+files-community-bot[bot]@users.noreply.github.com
59+
60+
# Determines the way the action fills missing author name and email. Three options are available:
61+
# - github_actor -> UserName <[email protected]>
62+
# - user_info -> Your Display Name <[email protected]>
63+
# - github_actions -> github-actions <email associated with the github logo>
64+
# Default: github_actor
65+
default_author: github_actor
66+
67+
# The message for the commit.
68+
# Default: 'Commit from GitHub Actions (name of the workflow)'
69+
message: 'Bump Files UI controls micro version to ${{ steps.bump_version.outputs.new_version }}'
70+
71+
# If this input is set, the action will push the commit to a new branch with this name.
72+
# Default: ''
73+
new_branch: 'files/ui-controls/micro${{ steps.bump_version.outputs.new_version }}'
74+
75+
# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
76+
# - ignore -> errors will be logged but the step won't fail
77+
# - exitImmediately -> the action will stop right away, and the step will fail
78+
# - exitAtEnd -> the action will go on, every pathspec error will be logged at the end, the step will fail.
79+
# Default: ignore
80+
pathspec_error_handling: ignore
81+
82+
# Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info)
83+
# Default: true
84+
push: true

0 commit comments

Comments
 (0)