Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from tshion/feature/#6_auto_create_pr_version_up
Browse files Browse the repository at this point in the history
#6 アプリバージョンを更新するGitHub Actions の追加
  • Loading branch information
tshion authored Feb 23, 2024
2 parents 5bf2f53 + bbce94a commit 912268f
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/update-app-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Update app version

on:
workflow_dispatch:
inputs:
versionMajor:
description: 'バージョン情報: major'
required: true
type: string
versionMinor:
description: 'バージョン情報: minor'
required: true
type: string
versionPatch:
description: 'バージョン情報: patch'
required: true
type: string

jobs:
update-app-version:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4

# https://github.com/ruby/setup-ruby
- uses: ruby/setup-ruby@v1

- name: Update app version
id: app-version
run: |
ruby scripts/set-version.rb ${{ inputs.versionMajor }} ${{ inputs.versionMinor }} ${{ inputs.versionPatch }}
echo "$(ruby scripts/pick-version-name.rb)" > TMP_LOG
echo "version-name=$(cat TMP_LOG)" >> "$GITHUB_OUTPUT"
- name: Setup git settings
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
echo "Finish setup git"
- name: Git push
run: |
git switch -c "feature/${{ steps.app-version.outputs.version-name }}"
git add Build.xcconfig
git commit -m "Update app version ${{ steps.app-version.outputs.version-name }}"
git push origin
echo "Updated git"
- name: Create pull request
run: gh pr create --title "Update app version ${{ steps.app-version.outputs.version-name }}" --body ""
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 912268f

Please sign in to comment.