Skip to content

Commit 7bbcca0

Browse files
committed
build.yaml: add auto release
1 parent c88ab52 commit 7bbcca0

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

.github/workflows/build.yaml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Build
22
on:
3-
- push
4-
- release
5-
- pull_request
6-
- workflow_dispatch
3+
release:
4+
types: [created]
5+
push:
6+
pull_request:
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'which tag to create and release?'
11+
required: true
12+
default: 'v100'
713

814
jobs:
915
build:
@@ -14,37 +20,63 @@ jobs:
1420
- amd64
1521
- x86
1622
steps:
17-
- uses: actions/checkout@v4
23+
- name: Checkout repo
24+
uses: actions/checkout@v4
25+
1826
- name: setup MS dev commands
1927
uses: ilammy/msvc-dev-cmd@v1
2028
with:
2129
arch: ${{ matrix.arch }}
30+
2231
- name: Setup Python
2332
uses: actions/setup-python@v6
2433
with:
2534
python-version: '3.x'
35+
2636
- name: install meson and ninja
2737
run: pip install meson ninja
38+
2839
- name: Plug in vs-api3
2940
shell: bash
3041
run: |
3142
git clone https://github.com/AmusementClub/vs-api3 --depth=1 --branch master api3
3243
cp api3/api3.cc src/
3344
sed -i -e "/vsplugin.cc'/s//&, 'src\\/api3.cc'/" meson.build
3445
cat meson.build
46+
3547
- name: download VS headers and patch header location
3648
shell: bash
3749
run: |
3850
git clone https://github.com/AmusementClub/vapoursynth-classic --depth=1 --branch doodle2 vapoursynth
3951
cp vapoursynth/include/*.h src/
4052
sed -i -e '/#include <vapoursynth/ { s|vapoursynth/||g; y|<>|""|; }' src/vsplugin.cc
53+
4154
- name: Meson setup
4255
run: meson setup builddir/ -Db_vscrt=mt
56+
4357
- name: Meson compile
4458
run: meson compile -C builddir/ -v
59+
60+
- name: Package Release
61+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
62+
shell: bash
63+
run: |
64+
git clone https://github.com/AkarinVS/exe/
65+
cd builddir/
66+
../exe/zip.exe -9r ../descale-${{github.ref_name}}-${{matrix.arch}}.zip *.dll
67+
4568
- name: Upload artifact
4669
uses: actions/upload-artifact@v4
4770
with:
4871
name: release-${{matrix.arch}}
4972
path: |
5073
builddir/descale.dll
74+
75+
- name: Release
76+
uses: softprops/action-gh-release@v2
77+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
78+
with:
79+
files: "descale-${{github.ref_name}}-${{matrix.arch}}.zip"
80+
prerelease: true
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)