|
83 | 83 | targets-matrix: ${{ steps.targets-matrix.outputs.matrix }} |
84 | 84 | # パッケージのアップロードが必要かどうか |
85 | 85 | need-upload: ${{ steps.need-upload.outputs.need-upload }} |
86 | | - # リポジトリがプライベートかどうか |
87 | | - is-private-repo: ${{ steps.check-repo-visibility.outputs.is-private }} |
88 | 86 |
|
89 | 87 | steps: |
90 | 88 | - name: 📥 Check out the repo |
|
94 | 92 | ref: ${{ inputs.is-merged == true && github.base_ref || inputs.pr-head-sha }} |
95 | 93 | fetch-depth: 0 |
96 | 94 |
|
97 | | - - name: 🔍 Check repository visibility |
98 | | - id: check-repo-visibility |
99 | | - uses: actions/github-script@v8 |
100 | | - with: |
101 | | - script: | |
102 | | - const repo = await github.rest.repos.get({ |
103 | | - owner: context.repo.owner, |
104 | | - repo: context.repo.repo |
105 | | - }); |
106 | | - const isPrivate = repo.data.private; |
107 | | - core.setOutput('is-private', isPrivate); |
108 | | - core.info(`Repository is ${isPrivate ? 'private' : 'public'}`); |
109 | | -
|
110 | 95 | - name: 🏷️ Bump version and push tag |
111 | 96 | id: tag-version |
112 | 97 | uses: mathieudutour/github-tag-action@v6.2 |
@@ -154,9 +139,8 @@ jobs: |
154 | 139 | # Dockerイメージをビルドする |
155 | 140 | build: |
156 | 141 | name: Docker build (${{ matrix.target.packageName }}, ${{ matrix.platform }}) |
157 | | - # matrix.platform が linux/arm64 かつ パブリックリポジトリの場合は ubuntu-24.04-arm を使う。それ以外の場合は ubuntu-latest を使う |
158 | | - # プライベートリポジトリでは ubuntu-24.04-arm が利用できないため、ubuntu-latest を使う |
159 | | - runs-on: ${{ matrix.platform == 'linux/arm64' && needs.calc-version.outputs.is-private-repo == 'false' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} |
| 142 | + # matrix.platform が linux/arm64 の場合は ubuntu-24.04-arm を使う。それ以外の場合は ubuntu-latest を使う |
| 143 | + runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} |
160 | 144 | needs: calc-version |
161 | 145 |
|
162 | 146 | strategy: |
@@ -201,14 +185,6 @@ jobs: |
201 | 185 | # マージされていない時には github.event.pull_request.head.sha を使い、マージされた時にはgithub.base_refを使う |
202 | 186 | ref: ${{ inputs.is-merged == true && github.base_ref || inputs.pr-head-sha }} |
203 | 187 |
|
204 | | - - name: 🛠️ Set up QEMU |
205 | | - # QEMU はクロスコンパイル時のみ必要。ネイティブビルド時はスキップする |
206 | | - # - linux/amd64 を ubuntu-latest (amd64) でビルドする場合は不要 |
207 | | - # - linux/arm64 を ubuntu-24.04-arm (arm64) でビルドする場合は不要 |
208 | | - # - linux/arm64 をプライベートリポジトリで ubuntu-latest (amd64) でビルドする場合のみ必要 |
209 | | - if: matrix.platform == 'linux/arm64' && needs.calc-version.outputs.is-private-repo == 'true' |
210 | | - uses: docker/setup-qemu-action@v3 |
211 | | - |
212 | 188 | - name: 🐳 Set up Docker Buildx |
213 | 189 | uses: docker/setup-buildx-action@v3 |
214 | 190 |
|
|
0 commit comments