-
Notifications
You must be signed in to change notification settings - Fork 2.6k
53 lines (47 loc) · 1.43 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
name: Release
on:
push:
branches:
- master
paths:
- './version.json'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Zip TV directory
id: zip_tv
run: |
zip -r tv.zip ./TV
- name: Get version and name from version.json
id: get_info
run: |
echo "version=$(node -p "require('./version.json').version")" >> $GITHUB_ENV
echo "name=$(node -p "require('./version.json').name")" >> $GITHUB_ENV
- name: Get changelog
id: get_changelog
run: |
echo "changelog=$(sed -n '/## '${version}'/,/##/p' CHANGELOG.md | head -n -1 | tail -n +2)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
release_name: v${{ env.version }}
body: ${{ env.changelog }}
draft: false
prerelease: false
- name: Upload ZIP 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: ./tv.zip
asset_name: ${{ env.name }}.zip
asset_content_type: application/zip