Skip to content

Commit cf8dcdc

Browse files
committed
Create release and upload asset
1 parent 528ecde commit cf8dcdc

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
name: Build
2+
13
on:
24
push:
35
branches: [ master ]
6+
tags:
7+
- 'v*'
48
pull_request:
59
branches: [ master ]
610

7-
name: Build
8-
911
jobs:
1012

1113
build:
@@ -31,7 +33,31 @@ jobs:
3133
working-directory: openvpn
3234

3335
- name: Upload artifact
34-
uses: actions/upload-artifact@v1
36+
uses: actions/upload-artifact@v2
3537
with:
3638
name: openvpn-linux-amd64.tar.gz
3739
path: openvpn/openvpn-linux-amd64.tar.gz
40+
41+
- name: Create Release
42+
if: startsWith(github.ref, 'refs/tags/v')
43+
id: create_release
44+
uses: actions/create-release@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
tag_name: ${{ github.ref }}
49+
release_name: ${{ github.ref }}
50+
draft: false
51+
prerelease: false
52+
53+
- name: Upload Release Asset
54+
if: startsWith(github.ref, 'refs/tags/v')
55+
id: upload-release-asset
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: openvpn/openvpn-linux-amd64.tar.gz
62+
asset_name: openvpn-linux-amd64.tar.gz.zip
63+
asset_content_type: application/zip

0 commit comments

Comments
 (0)