-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1003 Bytes
/
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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
INCLUDE: "./MphpD/"
TAGNAME: "${{ github.ref_name }}"
OUTFILE: "mphpd-${{ github.ref_name }}"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: rename src
run: mv ./src ./MphpD
- name: move .md files to MphpD
run: cp ./LICENSE.md ./README.md ./CHANGELOG.md ./MphpD/
- name: parse changelog
run: |
echo "# Changelog" > CHANGES.md
awk -v version="${{ env.TAGNAME }}" '/## /{printit = $2 == version}; printit;' ./CHANGELOG.md >> CHANGES.md
- name: Zip Folder
run: zip -r "${{ env.OUTFILE }}.zip" ${{ env.INCLUDE }}
- name: Tar Folder
run: tar -cvzf "${{ env.OUTFILE }}.tar.gz" ${{ env.INCLUDE }}
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ./CHANGES.md
files: |
${{ env.OUTFILE }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}