aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/windows.yml
blob: c066971df0ad9b7f23938f5593e48e469bd15618 (plain)
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
name: Windows

on:
  push:
    branches: [ main ]
    tags: 'v*.*.*'
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup msbuild
        uses: microsoft/setup-msbuild@v1.0.2
      - name: Windows build
        run: |
          msbuild win-build\Yuescript.sln /p:Configuration=Release /p:Platform=x86
          msbuild win-build\Yuescript.sln /p:Configuration=Release /p:Platform=x64
      - name: pack
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          (cd bin\windows\Win32\Release && 7z a ..\..\..\..\yue-windows-x86.7z yue.exe && cd ..\..\..\..)
          (cd bin\windows\x64\Release && 7z a ..\..\..\..\yue-windows-x64.7z yue.exe && cd ..\..\..\..)
      - name: Windows build Lua 5.1 dll
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          msbuild win-build\Yuescript.sln /p:Configuration=Release51 /p:Platform=x86
          msbuild win-build\Yuescript.sln /p:Configuration=Release51 /p:Platform=x64
          (cd bin\windows\Win32\Release && 7z a ..\..\..\..\yue-windows-x86-lua51-dll.7z yue.dll && cd ..\..\..\..)
          (cd bin\windows\x64\Release && 7z a ..\..\..\..\yue-windows-x64-lua51-dll.7z yue.dll && cd ..\..\..\..)
      - name: Windows build Lua 5.3 dll
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          msbuild win-build\Yuescript.sln /p:Configuration=Release53 /p:Platform=x86
          msbuild win-build\Yuescript.sln /p:Configuration=Release53 /p:Platform=x64
          (cd bin\windows\Win32\Release && 7z a ..\..\..\..\yue-windows-x86-lua53-dll.7z yue.dll && cd ..\..\..\..)
          (cd bin\windows\x64\Release && 7z a ..\..\..\..\yue-windows-x64-lua53-dll.7z yue.dll && cd ..\..\..\..)
      - name: release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            yue-windows-x86.7z
            yue-windows-x64.7z
            yue-windows-x86-lua51-dll.7z
            yue-windows-x64-lua51-dll.7z
            yue-windows-x86-lua53-dll.7z
            yue-windows-x64-lua53-dll.7z
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}