-
Notifications
You must be signed in to change notification settings - Fork 41
101 lines (88 loc) · 2.64 KB
/
ci.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
name: build cli
on:
push:
tags:
- 'v*'
branches:
- '**'
paths:
- '.github/workflows/ci.yml'
- 'source/cli/**'
- 'MaaFramework/**'
- 'assets/**'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/ci.yml'
- 'source/cli/**'
- 'MaaFramework/**'
- 'assets/**'
workflow_dispatch:
jobs:
meta:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set_tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
- id: set_tag
run: |
echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT
windows:
needs: meta
strategy:
matrix:
include:
- msbuild_target: x64
lowercase_target: x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Update resource version
run: |
python3 .github/update_resource_version.py assets/resource/properties.json ${{ needs.meta.outputs.tag }}
- name: Download MaaFramework
uses: robinraju/[email protected]
with:
repository: MaaAssistantArknights/MaaFramework
latest: false
tag: "v0.3.5"
fileName: "MAA-win-x86_64*"
out-file-path: "source/cli/${{ matrix.msbuild_target }}/Release"
extract: true
- run: ls -l source/cli/${{ matrix.msbuild_target }}/Release
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build MAA
run: |
MSBUILD source/cli/MAA1999_CLI.sln /t:rebuild /p:Configuration="Release" /p:Platform="${{ matrix.msbuild_target }}" /m /p:MAA_VERSION="${{ needs.meta.outputs.tag }}"
- name: Install
shell: bash
run: |
cd source/cli/${{ matrix.msbuild_target }}/Release
mkdir -p install
cp -r docs include resource MaaAgentBinary *.exe *.dll install
- uses: actions/upload-artifact@v3
with:
name: MAA1999-win-${{ matrix.msbuild_target }}
path: source/cli/${{ matrix.msbuild_target }}/Release/install
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [meta, windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: assets
- run: |
cd assets
for f in *; do
(cd $f && zip -r ../$f-${{ needs.meta.outputs.tag }}.zip .)
done
- uses: softprops/action-gh-release@v1
with:
files: assets/*
tag_name: ${{ needs.meta.outputs.tag }}