-
Notifications
You must be signed in to change notification settings - Fork 47
45 lines (45 loc) · 1.52 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
name: release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-20.04
steps:
- id: changelog
uses: zhaojh329/auto-changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
body: ${{steps.changelog.outputs.changelog}}
- uses: actions/checkout@v2
with:
submodules: true
- id: get-version
uses: battila7/get-version-action@v2
- id: release-asset
run: |
version=${{ steps.get-version.outputs.version-without-v }}
cd ..
cp -r libumqtt libumqtt-$version
rm -rf libumqtt-$version/.git* libumqtt-$version/src/buffer/.git* libumqtt-$version/src/ssl/.git*
tar zcfv libumqtt-$version.tar.gz libumqtt-$version
echo "::set-output name=asset-path::../libumqtt-$version.tar.gz"
echo "::set-output name=asset-name::libumqtt-$version.tar.gz"
- id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{ steps.release-asset.outputs.asset-path }}
asset_name: ${{ steps.release-asset.outputs.asset-name }}
asset_content_type: application/gzip