Skip to content

Commit

Permalink
feat: add WinSW.xml for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNotGoodName committed Nov 3, 2023
1 parent 96d9b99 commit 4901d26
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 12 deletions.
29 changes: 17 additions & 12 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tasks:
clean:
cmds:
- rm -rf dist
- mkdir -p dist
- mkdir -p dist/artifacts

build-apk:
internal: true
Expand Down Expand Up @@ -62,28 +62,33 @@ tasks:
LDFLAGS: -s -w -X {{.BUILD_PACKAGE_NAME}}.Version={{.BUILD_VERSION}} -X {{.BUILD_PACKAGE_NAME}}.Commit={{.BUILD_COMMIT}} -X {{.BUILD_PACKAGE_NAME}}.Date={{.BUILD_DATE}} -X {{.BUILD_PACKAGE_NAME}}.RepoURL={{.BUILD_REPO_URL}}
MAIN_PACKAGE: "{{.PACKAGE_NAME}}/cmd/radiomux"

checksum:
compile-artifacts:
internal: true
dir: dist/artifacts
cmds:
- sha256sum *.tar.gz *.zip *.apk > checksum.txt

build:
deps: [clean, build-apk, build-server]
dir: dist
cmds:
- cp *.apk artifacts/
- for: { var: FILES }
cmd: cp ../{{.ITEM}} .
- mkdir -p artifacts
- cp radiomuxplayer-release.apk artifacts/
- for: { var: WINDOWS_FILES }
cmd: cp ../{{.ITEM}} .
- tar -czf artifacts/radiomux_Linux_x86_64.tar.gz radiomux_Linux_x86_64 {{.FILES}}
- tar -czf artifacts/radiomux_Linux_armv7.tar.gz radiomux_Linux_armv7 {{.FILES}}
- tar -czf artifacts/radiomux_Linux_arm64.tar.gz radiomux_Linux_arm64 {{.FILES}}
- tar -czf artifacts/radiomux_Darwin_arm64.tar.gz radiomux_Darwin_arm64 {{.FILES}}
- zip -q artifacts/radiomux_Windows_x86_64.zip radiomux_Windows_x86_64.exe {{.FILES}}
- task: checksum
- zip -q artifacts/radiomux_Windows_x86_64.zip radiomux_Windows_x86_64.exe {{.FILES}} {{.WINDOWS_FILES}}
- cd artifacts && sha256sum *.tar.gz *.zip *.apk > checksum.txt
vars:
FILES: README.md LICENSE
WINDOWS_FILES: WinSW.xml

build:
deps: [clean, build-apk, build-server]
dir: dist
cmds:
- task: compile-artifacts

build-debug:
deps: [clean, build-apk-debug, build-server]
dir: dist
cmds:
- task: compile-artifacts
48 changes: 48 additions & 0 deletions WinSW.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
MIT License
Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees,
Inc., Oleg Nenashev and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->

<!--
This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options.
This configuration file should be placed near the WinSW executable, the name should be the same.
E.g. for myapp.exe the configuration file name should be myapp.xml
You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md
Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml
-->
<service>

<!-- ID of the service. It should be unique across the Windows system-->
<id>com.gurnain.radiomux</id>
<!-- Display name of the service -->
<name>RadioMux Service (powered by WinSW)</name>
<!-- Service description -->
<description>Use your Android devices as remote controlled audio players.</description>

<!-- Path to the executable, which should be started -->
<executable>%BASE%\radiomux.exe</executable>

</service>

0 comments on commit 4901d26

Please sign in to comment.