-
Notifications
You must be signed in to change notification settings - Fork 69
129 lines (111 loc) · 3.25 KB
/
Copy pathrelease.yaml
File metadata and controls
129 lines (111 loc) · 3.25 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Release
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
UNP4K_VERSION: 3.13.${{ github.run_number }}
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Nuget
uses: nuget/setup-nuget@v2
with:
nuget-version: '5.x'
- name: Setup MSBuild
id: setup_msbuild
uses: microsoft/setup-msbuild@v2
- name: Restore dependencies
run: nuget restore
- name: Build
run: msbuild unp4k.sln /m /verbosity:minimal /p:Configuration=Release
- name: Package
shell: cmd
run: |
cd src
copy unp4k\bin\Release\net47\win-x64\unp4k.exe unp4k.gui\bin\Release\unp4k.exe
erase *.pdb /s
erase *.exe.config /s
erase *.xml /s
erase System.Net.Http.dll /s
erase System.Runtime.dll /s
erase System.IO.dll /s
erase System.Security.*.dll /s
- uses: actions/upload-artifact@v4
with:
name: unp4k-suite-v${{ env.UNP4K_VERSION }}
path: src/unp4k.gui/bin/Release
- uses: actions/upload-artifact@v4
with:
name: unforge-v${{ env.UNP4K_VERSION }}
path: src/unforge/bin/Release/net481
- uses: actions/upload-artifact@v4
with:
name: unp4k-v${{ env.UNP4K_VERSION }}
path: src/unp4k/bin/Release/net481
release:
needs: build
runs-on: ubuntu-latest
if: (github.event_name == 'push')
outputs:
id: ${{ steps.create_release.outputs.id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
- name: Load README
run: |
echo "README<<EOF" >> $GITHUB_ENV
cat README.md >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.UNP4K_VERSION }}
release_name: unp4k Tools for Star Citizen
body: ${{ env.README }}
draft: true
prerelease: false
upload:
needs: release
runs-on: ubuntu-latest
if: (github.event_name == 'push')
strategy:
max-parallel: 3
matrix:
artifact: [ unp4k, unp4k-suite, unforge ]
steps:
- name: Load Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }}
path: ${{ matrix.artifact }}
- name: Compress Artifacts
run: (cd ${{ matrix.artifact }} && zip -r ../${{ matrix.artifact }}.zip .)
- name: Upload Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.artifact }}.zip
asset_name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }}.zip
asset_content_type: application/zip
publish:
needs: [ upload, release ]
runs-on: ubuntu-latest
if: (github.event_name == 'push')
steps:
- name: Publish Release
uses: StuYarrow/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ needs.release.outputs.id }}