Skip to content

Commit

Permalink
Merge pull request #5 from stop-pattern/feature/tag
Browse files Browse the repository at this point in the history
tag/releaseを自動生成
  • Loading branch information
stop-pattern authored Dec 7, 2023
2 parents 09c940e + ebb6539 commit 78c7d0a
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 12 deletions.
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: MSBuild

on:
pull_request:
push:
branches:
#- main
- main
- develop
paths:
- '*/**'
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Create release
on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed

jobs:
build:
name: Generate dll
runs-on: windows-latest
outputs:
name: ${{ steps.version.outputs.name }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Setup Nuget
uses: NuGet/setup-nuget@v1.2.0
- name: Restore nuget packages
run: nuget restore AtsExCsTemplate.sln
- name: Build sln
run: msbuild AtsExCsTemplate.sln /m /p:configuration="Release" /p:platform="Any CPU" /p:OutputPath="./out/"
shell: cmd
- name: Collect artifact
run: |
mkdir plugins/
find . -type f -path '*/out/*.dll' | xargs mv -t ./plugins/
shell: bash
- name: Check assembly version
id: version
run: |
Get-ChildItem plugins/ -Recurse -Filter "*.dll" -File | foreach {
Write-Output $_.FileName
$_.FileName
"name=$_" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
$ver=(Get-Item $_.FullName).VersionInfo.FileVersion
$ver
"version=v$ver" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
}
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: plugins
path: ./plugins/

release:
name: Create release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create tag
run: |
git tag ${{needs.build.outputs.version}}
git push origin ${{needs.build.outputs.version}}
- name: Create release draft
id: create-draft
uses: release-drafter/release-drafter@v5.12.1
with:
version: ${{needs.build.outputs.version}}
name: ${{needs.build.outputs.version}}
tag: ${{needs.build.outputs.version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download a build artifact
uses: actions/download-artifact@v3.0.2
- name: Get repository name
run: |
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
echo "FILE_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}_${{needs.build.outputs.version}}" >> $GITHUB_ENV
- name: Compress DLLs
run: |
cd plugins/
zip ${{env.FILE_NAME}}.zip -r *
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create-draft.outputs.upload_url}}
asset_path: ./plugins/${{env.FILE_NAME}}.zip
asset_name: ${{env.FILE_NAME}}.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion Extension/Extension.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>Extension</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
3 changes: 1 addition & 2 deletions Extension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.11.*")]
4 changes: 2 additions & 2 deletions MapPlugin/MapPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>MapPlugin</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -88,4 +88,4 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
3 changes: 1 addition & 2 deletions MapPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
3 changes: 1 addition & 2 deletions VehiclePlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.*")]
4 changes: 2 additions & 2 deletions VehiclePlugin/VehiclePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>VehiclePlugin</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -88,4 +88,4 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

0 comments on commit 78c7d0a

Please sign in to comment.