1- name : Build, Release
1+ name : Create Release
22
33on :
4- pull_request :
5- branches : [main]
6- types : [closed]
7- tags :
8- - v*
4+ workflow_dispatch :
95
106env :
117 APP_NAME : mediadc
128
139jobs :
1410 build_app :
1511 runs-on : ubuntu-latest
16- if : startsWith(github.ref, 'refs/tags/v') && github.event.pull_request.merged == true
17- name : Build and package app
12+ name : Build and create release
1813
1914 steps :
2015 - name : Checkout
2116 uses : actions/checkout@v2
2217
18+ - name : Archive Source
19+ uses : thedoctor0/zip-release@master
20+ with :
21+ type : ' zip'
22+ filename : ' Sources.zip'
23+ exclusions : ' *.git*'
24+
2325 - name : Setup Node
2426 uses : actions/setup-node@v2
2527 with :
2830 - name : Build
2931 run : make
3032
33+ - name : Get names
34+ id : get_version
35+ run : |
36+ APP_VERSION=$(sed -n "s/<version>\(.*\)<\/version>/\\1/p" ./appinfo/info.xml | tr -d '\t')
37+ echo $APP_VERSION
38+ echo "::set-output name=version::v${APP_VERSION}"
39+ echo "::set-output name=tag::v${APP_VERSION}"
40+
3141 - name : Install Krankerl
3242 run : |
3343 wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb
@@ -42,27 +52,13 @@ jobs:
4252 path : build/artifacts/${{ env.APP_NAME }}.tar.gz
4353 if-no-files-found : error
4454
45- create_release :
46- runs-on : ubuntu-latest
47- if : startsWith(github.ref, 'refs/tags/v') && github.event.pull_request.merged == true
48- name : Build and package app
49- needs : [build_app]
50-
51- steps :
52- - name : Collect app build
53- uses : actions/download-artifact@v2
54- with :
55- name : tarball
56-
57- - name : Get release name
58- id : get_version
59- run : |
60- echo "::set-output name=version::${GITHUB_REF##refs/tags/v}"
61-
62- - name : Upload app to release
55+ - name : Create release draft
63566457 with :
6558 name : ${{ steps.get_version.outputs.version }}
59+ tag : ${{ steps.get_version.outputs.tag }}
60+ commit : ${{ github.ref }}
6661 draft : true
67- artifacts : tarball
62+ artifacts : " build/artifacts/${{ env.APP_NAME }}.tar.gz,Sources.zip "
6863 token : ${{ secrets.GITHUB_TOKEN }}
64+ artifactErrorsFailBuild : true
0 commit comments