forked from 34736384/genshin-fps-unlock
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (49 loc) · 1.64 KB
/
publish.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
name: publish
env:
ProjectName: genshin-fps-unlock
on:
create:
tags:
- "v*.*.*"
jobs:
build:
name: Build and Release
if: ${{ StartsWith(github.ref, 'refs/tags/') }}
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Publish
if: ${{ success() }}
shell: pwsh
run: |
echo ${{ github.ref }}
dotnet publish unlockfps_gui --runtime win-x64 --configuration Release --output ci-publish-win64
rm ./ci-publish-win64/*.pdb
- name: Get tag
uses: dawidd6/action-get-tag@v1
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }}
id: tag
- name: Pack via 7z
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir -p ./ci-pack/
7z a -mx9 -mfb=273 -ms -md=31 -myx=9 -mtm=- -mmt -mmtf -md=1536m -mmf=bt3 -mmc=10000 -mpb=0 -mlc=0 "./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}-win64.7z" "./ci-publish-win64/*" -x!"${{ env.ProjectName }}" -r
- name: Create a new GitHub release if a new tag is pushed
uses: softprops/action-gh-release@v1
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
name: ${{ steps.tag.outputs.tag }}
prerelease: true
draft: false
files: |
./ci-pack/${{ env.ProjectName }}-${{ steps.tag.outputs.tag }}-win64.7z