-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (94 loc) · 2.8 KB
/
release_build.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
name: Release Build
on:
push:
branches: [master]
paths-ignore:
- "*.md"
- "LICENSE"
- ".gitignore"
- ".github/**"
pull_request:
branches: [master]
types:
- synchronize
- labeled
paths-ignore:
- "*.md"
- "LICENSE"
- ".gitignore"
jobs:
Build:
if: ${{ github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'update-pr') }}
uses: ./.github/workflows/build.yml
with:
build_type: Release
Update_Release:
name: 'Create/Update Release Asset'
needs: Build
outputs:
version: ${{ steps.version.outputs.prop }}
if: ${{ github.ref != 'refs/heads/master' && contains(github.event.pull_request.labels.*.name, 'update-pr') }}
runs-on: ubuntu-latest
steps:
- name: Download Winch Asset
uses: actions/download-artifact@v4
with:
name: Winch
path: Winch
- name: Zip Winch Asset
run: |
cd Winch/
zip -r Winch.zip *
mv Winch.zip ..
cd ..
- name: Download Example Mods
uses: actions/download-artifact@v4
with:
name: Winch Examples
path: Examples
- name: Zip Example Mods
run: |
for mod in DisasterButton ExampleItems IntroSkipper
do
cd Examples/$mod/
zip -r $mod.zip *
mv $mod.zip ../..
cd ../..
done
- name: Upload Asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
commit: master
tag: v${{ github.event.pull_request.title }}
name: Version ${{ github.event.pull_request.title }}
omitBodyDuringUpdate: true
artifacts: Winch.zip, DisasterButton.zip, ExampleItems.zip, IntroSkipper.zip
draft: true
prerelease: false
Pack_Nuget:
name: Pack nuget
needs: Update_Release
runs-on: windows-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: Winch/mod_meta.json
prop_path: Version
- name: Set up nuget
uses: NuGet/[email protected]
- name: Download Winch Asset
uses: actions/download-artifact@v4
with:
name: Winch
path: Winch/bin
- name: Pack nuget
run: nuget pack Winch/Winch.nuspec -Properties "version=${{ steps.version.outputs.prop }}"
- run: dir
- name: Publish nuget
run: nuget push "Winch.*.nupkg" -ApiKey ${{ secrets.NUGET_KEY }} -Source https://api.nuget.org/v3/index.json