forked from blueblur0730/modified-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (106 loc) · 3.2 KB
/
Copy pathcompile_or_release.yml
File metadata and controls
130 lines (106 loc) · 3.2 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
# This is a basic workflow that is manually triggered
# Is it a ci?
name: Compile or Release
on:
pull_request:
paths: ["source/**", "include/**"]
branches: [master, main, workflow]
push:
paths: ["source/**", "include/**"]
branches: [master, main, workflow]
workflow_dispatch:
jobs:
build:
name: Build with sm-${{ matrix.sm_version }}
strategy:
fail-fast: false
matrix:
sm_version: ["1.12", "1.13"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repo
with:
submodules: recursive
- name: Retrive Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- uses: actions/setup-python@v5
name: Prepare Python
with:
python-version: 3.11
- name: Install NinjaBuild
run: sudo apt-get update && sudo apt-get install -y ninja-build
- uses: rumblefrog/setup-sp@master
name: Install SourcePawn Compiler
with:
version: ${{ matrix.sm_version }}
- name: Configure and Build
run: |
python3 configure.py --spcomp-dir "$scriptingPath"
ninja
- uses: actions/upload-artifact@v4
name: Upload the Package
with:
name: modified-plugins-sm-${{ matrix.sm_version }}-${{ env.DATE }}
path: |
build/source/
build/include/
LICENSE
README.md
README-cn.md
delete:
name: delete old assets
runs-on: ubuntu-latest
steps:
- name: Delete current release assets
uses: andreaswilli/delete-release-assets-action@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# tagPrefix:
tag: release
deleteOnlyFromDrafts: false
release:
strategy:
fail-fast: false
matrix:
sm_version: ["1.12", "1.13"]
name: Release with sm-${{ matrix.sm_version }}
# only release if the workflow is manually triggered
# if: contains(fromJson('["workflow_dispatch"]'), github.event_name)
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repo
with:
submodules: recursive
- name: Retrive Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Download package
uses: actions/download-artifact@v4
with:
path: tmp/
pattern: modified-plugins-sm-${{ matrix.sm_version }}-${{ env.DATE }}
- name: Prepare Release
working-directory: tmp/
run: |
for i in */;
do
zip -0 -r "${i%/}.zip" "$i" &
done;
wait
- name: Release
uses: xresloader/upload-to-github-release@v1
with:
file: tmp/modified-plugins-sm-${{ matrix.sm_version }}-*.zip
# delete_file: modified-plugins-sm-${{ matrix.sm_version }}-*.zip
draft: false
prerelease: false
branches: main
tag_name: release
tags: true
update_latest_release: true
# verbose: true
overwrite: true
default_release_name: modified-plugins
token: ${{ secrets.GITHUB_TOKEN }}