-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (84 loc) · 2.66 KB
/
releaser.yml
File metadata and controls
101 lines (84 loc) · 2.66 KB
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
name: releaser
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup MSVC (x64)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Download sdk
run: |
Invoke-WebRequest -UserAgent "Wget" -Uri https://spring-fragrance.mints.ne.jp/aviutl/aviutl2_sdk.zip -OutFile aviutl2_sdk.zip
Expand-Archive -Path aviutl2_sdk.zip -DestinationPath ./dll_src/aviutl2_sdk -Force
Remove-Item aviutl2_sdk.zip -Force
- name: Convert file encoding
run: |
$folder = "./dll_src/aviutl2_sdk"
Get-ChildItem -Path $folder -Filter "*.h" -Recurse | ForEach-Object {
$file = $_.FullName
$content = Get-Content $file -Raw -Encoding "shift_jis"
$content = $content -replace "`r`n", "`n"
Set-Content $file -Value $content -Encoding utf8
}
- name: Build
run: |
cd ${{ github.workspace }}
$version = "${{ github.ref_name }}" -replace '^v', ''
cmake -S dll_src -B dll_src/build -DCMAKE_GENERATOR_PLATFORM=x64 -DVERSION="$version"
cmake --build dll_src/build --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: module
path: ${{ github.workspace }}/dll_src/build/Release/*.mod2
releaser:
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: module
path: ${{ github.workspace }}/dll_src/build/Release
- name: Extract script name
run: |
REPO_BASE=$(basename "${{ github.repository }}")
MIDDLE_PART=$(echo "$REPO_BASE" | sed 's/AviUtl2_\(.*\)_Script/\1/')
echo "SCRIPT_NAME=$MIDDLE_PART" >> $GITHUB_ENV
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Build script
run: |
pip install git+https://github.com/korarei/AviUtl2_Astra.git@v0.3.0
cd ${{ github.workspace }}/scripts
astra build -v ${{ github.ref_name }}
astra release
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.SCRIPT_NAME }}_${{ github.ref_name }}
files: 'scripts/release/*.zip'
body_path: scripts/release/release_notes.txt