-
Notifications
You must be signed in to change notification settings - Fork 8
109 lines (95 loc) · 3.12 KB
/
release.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
101
102
103
104
105
106
107
108
109
---
name: "Create Release"
on:
workflow_run:
workflows: ["Tag Release"]
types:
- completed
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: true
ref: ${{ env.LATEST_TAG }}
- name: Get the latest tag
run: |
git fetch --tags
LATEST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV"
- name: Pull LFS
run: git lfs pull
- name: Archive Release
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'Immutable-Passport.zip'
directory: './src/Packages'
path: './Passport'
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configurationJson: |
{
"pr_template": "- #{{TITLE}} (##{{NUMBER}})",
"categories": [
{
"title": "## Features",
"labels": ["feature", "feat"]
},
{
"title": "## Fixes",
"labels": ["fix"]
},
{
"title": "## Performance",
"labels": ["performance"]
},
{
"title": "## Documentation",
"labels": ["docs"]
},
{
"title": "## Chores",
"labels": ["chore"]
}
]
}
- name: Extract TS SDK version from index.html
id: extract_ts_sdk_version
run: |
version=$(grep -oP '"x-sdk-version":"ts-immutable-sdk-\K[0-9]+\.[0-9]+\.[0-9]+' ./src/Packages/Passport/Runtime/Resources/index.html | head -n 1)
if [[ -z "$version" ]]; then
echo "Error: Version not found in index.html" >&2
exit 1
fi
version=$(echo "$version" | tr -d '\r\n')
echo "VERSION=${version}" >> "$GITHUB_ENV"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LATEST_TAG }}
release_name: ${{ env.LATEST_TAG }}
body: |
${{steps.github_release.outputs.changelog}}
Game bridge built from Immutable Typescript SDK version ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./src/Packages/Immutable-Passport.zip
asset_name: Immutable-Passport.zip
asset_content_type: application/zip