Skip to content

Commit 0a43534

Browse files
author
Bart Lauret
committed
Add Github Action to automate releasing and change maxTarget for this plugin
1 parent 0a2c40a commit 0a43534

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: Install dependencies
15+
run: sudo apt-get --no-install-recommends -yq install xmlstarlet
16+
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Zip plugin and update repo.xml
21+
run: |
22+
xmlstarlet ed --inplace --update "//extension/version" --value "${{ github.event.inputs.version }}" install.xml
23+
zip -r ${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip . -x ".git/*" ".github/*" "repo.xml"
24+
export SHA1SUM=`sha1sum "${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip" | awk '{ print $1 }'`
25+
export ZIP_URL="https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip"
26+
xmlstarlet ed --inplace --update "//extensions/plugins/plugin/sha" --value "$SHA1SUM" repo.xml
27+
xmlstarlet ed --inplace --update "//extensions/plugins/plugin/url" --value "$ZIP_URL" repo.xml
28+
xmlstarlet ed --inplace --update "//extensions/plugins/plugin/@version" --value "${{ github.event.inputs.version }}" repo.xml
29+
30+
- name: Commit changes
31+
run: |
32+
git config user.name github-actions
33+
git config user.email github-actions@github.com
34+
git commit -a -m "Release ${{ github.event.inputs.version }}"
35+
git push
36+
37+
- name: Create Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
tag_name: ${{ github.event.inputs.version }}
44+
release_name: Release ${{ github.event.inputs.version }}
45+
draft: false
46+
prerelease: false
47+
48+
- name: Upload Release Asset
49+
id: upload-release-asset
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ steps.create_release.outputs.upload_url }}
55+
asset_path: ./${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip
56+
asset_name: ${{ github.event.repository.name }}-${{ github.event.inputs.version }}.zip
57+
asset_content_type: application/zip

repo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title lang="EN">SigGen</title>
55
</details>
66
<plugins>
7-
<plugin name="SigGen" version="1.2" minTarget="7.3" maxTarget="8.*">
7+
<plugin name="SigGen" version="1.2" minTarget="7.3" maxTarget="*">
88
<title lang="EN">Signal Generator</title>
99
<desc lang="EN">Signal Generator plugin. Now supports Squeezeplay as well as SB2/3/Transporter.</desc>
1010
<creator>Triode</creator>

0 commit comments

Comments
 (0)