Skip to content

Commit

Permalink
[GitHub Actions] リリースを作成したタイミングでビルドし、ZIPアーカイブ化しリリースページへ添付するように
Browse files Browse the repository at this point in the history
  • Loading branch information
esperecyan committed May 4, 2023
1 parent c02da1d commit 77ad895
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ trim_trailing_whitespace = true
insert_final_newline = true
guidelines = 120 # 拡張機能「Editor Guidelines」が必要 https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines

[*.cs]
[*.{cs,yaml}]
indent_style = space

[*.cs]

#### .NET コーディング規則 ####
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
release:
types:
- published

jobs:
build:
permissions:
contents: write
runs-on: windows-2022
steps:
- name: メインブランチをチェックアウト
uses: actions/checkout@v3

- uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c #v1.3.1

- name: バージョン番号の取得
id: version
run: |
"version=$('${{ github.event.release.tag_name }}' -replace 'v', '')" >> $env:GITHUB_OUTPUT
- name: 依存関係の解決
run: MSBuild -target:Restore

- name: ビルド
run: MSBuild -property:Configuration=Release -property:OutputPath=./bin -property:Version=${{ steps.version.outputs.version }}

- name: アーカイブ化
run: Compress-Archive ./bin/* -DestinationPath 'ncv-voicevox-${{ steps.version.outputs.version }}.zip'

- name: リリースページへ添付
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 #v0.1.15
with:
files: ./*.zip
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.rulers": [ 120 ]
}

0 comments on commit 77ad895

Please sign in to comment.