Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: Add action to bump version number #13581

Closed
54 changes: 54 additions & 0 deletions .github/workflows/package-version-bumpup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Package Version Bump
run-name: Bump up Files to ${{ inputs.files_new_version }}
on:
workflow_dispatch:
inputs:
files_new_version:
description: 'New version number:'
required: true
package_version_type:
description: 'Package version type:'
type: choice
default: Release
options:
- Preview
- Release
- Test
- Servicing
required: false

jobs:
resources:
name: Bump up the package version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update Package.appxmanifest
run: |
sed -i "s/<Identity Name=\"\(.*\)\" Publisher=\"\(.*\)\" Version=\"\(.*\)\" \/>/<Identity Name=\"\1\" Publisher=\"\2\" Version=\"${{ inputs.files_new_version }}\" \/>/g" "src/Files.App (Package)/Package.appxmanifest"

- id: package_type_string
uses: ASzc/change-string-case-action@v5
with:
string: ${{ inputs.package_version_type }}

- name: Create a new PR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
commit-message: '${{ inputs.package_version_type }}: ${{ inputs.files_new_version }}'
committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: '${{ steps.package_type_string.outputs.lowercase }}/${{ inputs.files_new_version }}'
delete-branch: true
title: '${{ inputs.package_version_type }}: ${{ inputs.files_new_version }}'
body: |
### Summary
Bumps Files to **${{ inputs.files_new_version }}**.
Created by GitHub Actions on behalf of @${{ github.actor }}.

### Package type
**${{ inputs.package_version_type }}** package.
draft: false