-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (88 loc) · 2.88 KB
/
releaser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Make Release
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- '*'
env:
SOLUTION_NAME: tl_walkaround
# Path to the solution file relative to the root of the project.
TIME_ZONE: Asia/Tokyo
# Time zone for the timestamp when releasing.
permissions:
contents: read
jobs:
build:
name: Build
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x86]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} ${{ env.SOLUTION_NAME }}.sln
- name: Pack into a folder
run: |
mkdir pack
copy ${{ matrix.configuration }}/*.auf pack
xcopy assets pack /e /i
copy *.md pack
copy LICENSE pack
# pick up and add any files you may need.
- name: Upload the build as artifacts
uses: actions/upload-artifact@v4
with:
path: pack/*
name: ${{ env.SOLUTION_NAME }}-${{ github.ref_name }}_${{ matrix.platform }}${{ matrix.configuration }}
# name can be anything as long as you can recognize.
release:
name: Create Release
if: github.event_name == 'push' && github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true # assuming a single artifact.
- name: Compress
run: |
cd artifacts
zip -r ../aviutl_${{ env.SOLUTION_NAME }}-${{ github.ref_name }}.zip *
# rename .zip file for downloading if necessary.
- name: Prepare release notes
id: release-notes
run: |
echo "name=${{ github.ref_name }} ($(TZ='${{ env.TIME_ZONE }}' date +'%Y-%m-%d'))" >> $GITHUB_OUTPUT
echo "### 更新内容" >> ReleaseNotes.txt
phase=0
IFS=$'\n'
cat artifacts/README.md | while read line; do
if [[ $phase == 0 ]]; then
if [[ $line =~ ^##*[[:space:]]{1,}'改版履歴'[[:space:]]*$ ]]; then phase=1; fi
elif [[ $phase == 1 ]]; then
if [[ $line =~ ^-[[:space:]] ]]; then phase=2; fi
elif [[ $line =~ ^(-|##*)[[:space:]] ]]; then break
else
echo ${line:2} >> ReleaseNotes.txt
fi
done
- name: Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.release-notes.outputs.name }}
files: '*.zip'
body_path: ReleaseNotes.txt