-
-
Notifications
You must be signed in to change notification settings - Fork 27
57 lines (44 loc) · 1.62 KB
/
pull_request.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
name: Build Pull Request Godot Editor
on:
[pull_request]
jobs:
generate-build:
name: Generate Build of Pull Request
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Define Godot version based on branch name
run: |
GODOT_VERSION="${{ github.base_ref }}"
if [ "${{ github.base_ref }}" = "master" ]; then
GODOT_VERSION=4
elif [ "${{ github.base_ref }}" = "godot3" ]; then
GODOT_VERSION=3
fi
echo "GODOT_VERSION=${GODOT_VERSION}" >> $GITHUB_ENV
echo "TAG_PREFIX=godot${GODOT_VERSION}-" >> $GITHUB_ENV
- name: Get plugin version
uses: paulhatch/[email protected]
id: version
with:
tag_prefix: "${{env.TAG_PREFIX}}v"
major_pattern: "BREAKING CHANGE:"
minor_pattern: "feat:"
version_format: "v${major}.${minor}.${patch}-alpha.${increment}"
- name: Change version
run: |
REGEX_FIND_VERSION_TO_CHANGE_CONTENT_MD_FILE='(?<=version=")[^"]+'
perl -pi -e "s/$REGEX_FIND_VERSION_TO_CHANGE_CONTENT_MD_FILE/${{env.TAG_PREFIX}}${{ steps.version.outputs.version }}/g" addons/admob/plugin.cfg
- name: Compress .zip
run: |
git archive --format=zip --output compress.zip `git stash create`
- name: Uncompress .zip to Artifact
run: |
unzip compress.zip -d zip_extract_folder/
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: godot-${{env.GODOT_VERSION}}-admob-editor-${{ steps.version.outputs.version }}
path: zip_extract_folder/