-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.42 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
name: Create Github Release
on:
push:
branches:
- main
jobs:
CheckVersion:
runs-on: ubuntu-latest
outputs:
versionChanged: ${{ steps.check_version.outputs.changed }}
newVersion: ${{ steps.check_version.outputs.version }}
steps:
- name: Set up Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Check if version has been updated
id: check_version
uses: EndBug/version-check@v2
with:
diff-search: true
- name: Log version change
if: steps.check_version.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check_version.outputs.commit }}! New version: ${{ steps.check_version.outputs.version }}"'
CreateRelease:
needs: CheckVersion
if: needs.CheckVersion.outputs.versionChanged == 'true'
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy required files to release_files folder
run: |
mkdir release_files
cp ./LICENSE ./release_files/LICENSE
cp ./README.md ./release_files/README.md
cp ./config.default.json ./release_files/config.default.json
cp ./config.schema.json ./release_files/config.schema.json
cp ./index.js ./release_files/index.js
cp -r ./js ./release_files/js
cp ./package-lock.json ./release_files/package-lock.json
cp ./package.json ./release_files/package.json
- name: Create .zip of required files
run: |
cd release_files
zip -r ../Notion.Steam.API.Integration.zip *
- name: Create Release notes
run: |
echo "## What's Changed
" > CHANGELOG.md
LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git log --pretty=format:'* %s' $LAST_TAG..HEAD >> CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.CheckVersion.outputs.newVersion }}
name: v${{ needs.CheckVersion.outputs.newVersion }}
files: Notion.Steam.API.Integration.zip
body_path: CHANGELOG.md