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

#6 アプリバージョンを更新するGitHub Actions の追加 #7

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}