0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Release-DrafterにUnityのProjectSettingsのバージョンを流し込みたい

Last updated at Posted at 2024-02-07

結論

name: Release Drafter

on:
  push:
    branches:
      - stage

permissions:
  contents: read

jobs:
  update_release_draft:
    permissions:
      contents: write
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: setup bundleVersion
        run: |
          BUNDLE_VERSION=$(cat Unityのプロジェクト名/ProjectSettings/ProjectSettings.asset | grep bundleVersion: | tr -d "bundleVersion: ")
          echo $BUNDLE_VERSION
          echo "BUNDLE_VERSION=$BUNDLE_VERSION" >> $GITHUB_ENV
      - uses: release-drafter/release-drafter@v5
        with:
          name: ${{ env.BUNDLE_VERSION }}
          tag: ${{ env.BUNDLE_VERSION }}
          version: ${{ env.BUNDLE_VERSION }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

何をやっているか

    steps:
      - uses: actions/checkout@v4

プロジェクト情報を得るため、チェックアウトする

      - name: setup bundleVersion
        run: |
          BUNDLE_VERSION=$(cat Unityのプロジェクト名/ProjectSettings/ProjectSettings.asset | grep bundleVersion: | tr -d "bundleVersion: ")
          echo $BUNDLE_VERSION
          echo "BUNDLE_VERSION=$BUNDLE_VERSION" >> $GITHUB_ENV

ProjectSettingsからbundleVersionを引っこ抜く

      - uses: release-drafter/release-drafter@v5
        with:
          name: ${{ env.BUNDLE_VERSION }}
          tag: ${{ env.BUNDLE_VERSION }}
          version: ${{ env.BUNDLE_VERSION }}

release-drafterのAction Inputsを用いて、BUNDLE_VERSIONを流し込む

生成例

UnityのbundleVersionをタイトルに、リリースノート作ってくれる
スクリーンショット 2024-02-08 1.50.08.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?