File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Zip and release
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ version :
6+ description : ' version'
7+ required : true
8+
9+ jobs :
10+ build :
11+ name : Zip and release
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v2
16+
17+ - name : Zip plugin and update repo.xml
18+ run : |
19+ zip -r ${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip . -x ".git/*" ".github/*" "repo.xml"
20+ export SHA1SUM=`sha1sum "${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip" | awk '{ print $1 }'`
21+ export ZIP_URL="https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip"
22+ python -c "from xml.etree import ElementTree as et; tree = et.parse('repo.xml'); tree.find('.//sha').text = '$SHA1SUM'; tree.find('.//url').text = '$ZIP_URL'; tree.write('repo.xml')"
23+
24+ - name : Commit changes
25+ run : |
26+ git config user.name github-actions
27+ git config user.email [email protected] 28+ git commit -a -m "Release ${{ github.event.inputs.version }}"
29+ git push
30+
31+ - name : Create Release
32+ id : create_release
33+ uses : actions/create-release@v1
34+ env :
35+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36+ with :
37+ tag_name : ${{ github.event.inputs.version }}
38+ release_name : Release ${{ github.event.inputs.version }}
39+ draft : false
40+ prerelease : false
41+
42+ - name : Upload Release Asset
43+ id : upload-release-asset
44+ uses : actions/upload-release-asset@v1
45+ env :
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+ with :
48+ upload_url : ${{ steps.create_release.outputs.upload_url }}
49+ asset_path : ./${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip
50+ asset_name : ${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip
51+ asset_content_type : application/zip
You can’t perform that action at this time.
0 commit comments