aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml4
-rw-r--r--.github/workflows/publish.yml38
-rwxr-xr-xbin/publish22
-rw-r--r--src/slskd/slskd.csproj2
4 files changed, 18 insertions, 48 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c5115f72..57bef316 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,7 +34,7 @@ jobs:
name: web
path: src/slskd/wwwroot
- name: Publish ${{ matrix.runtime }}
- run: bin/publish --no-web-build --runtime ${{ matrix.runtime }}
+ run: bin/publish --no-build --runtime ${{ matrix.runtime }} --version-suffix $(echo $GITHUB_SHA | cut -c1-8)
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
@@ -49,4 +49,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
- run: docker build -t slskd/slskd:$(echo github.sha | cut -c1-8) . \ No newline at end of file
+ run: docker build -t slskd/slskd:$(echo $GITHUB_SHA | cut -c1-8) . \ No newline at end of file
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
deleted file mode 100644
index 135a9bf4..00000000
--- a/.github/workflows/publish.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-# # This is a basic workflow to help you get started with Actions
-
-# name: Publish
-
-# # Controls when the action will run.
-# on:
-# # Triggers the workflow on push or pull request events but only for the master branch
-# push:
-# branches: [ master ]
-
-# # Allows you to run this workflow manually from the Actions tab
-# workflow_dispatch:
-
-# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
-# jobs:
-# web:
-# runs-on: ubuntu-latest
-# steps:
-# - uses: actions/checkout@v2
-# - name: Build Static Web Content
-# run: bin/build --web-only
-# publish:
-# runs-on: ubuntu-latest
-# needs: web
-# strategy:
-# matrix:
-# runtime: ["win-x64", "linux-x64", "linux-musl-x64", "linux-arm64", "osx-x64"]
-# steps:
-# - uses: actions/checkout@v2
-# - name: Publish ${{ matrix.runtime }}
-# run: bin/publish --runtime ${{ matrix.runtime }}
-
-# - name: Upload a Build Artifact
-# uses: actions/upload-artifact@v2
-# with:
-# name: ${{ matrix.runtime }}
-# path: dist/${{ matrix.runtime }}
-
diff --git a/bin/publish b/bin/publish
index dfcfc315..9f0194ef 100755
--- a/bin/publish
+++ b/bin/publish
@@ -2,17 +2,19 @@
set -e
build=true
+version_suffix=$(git rev-parse --short HEAD)
while test $# -gt 0; do
case "$1" in
-h|--help)
echo 'options:'
- echo '-h, --help show help'
- echo '--no-web-build skip web build'
- echo '--runtine a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)'
+ echo '-h, --help show help'
+ echo '--no-build skip build'
+ echo '--version-suffix version suffix for the binary. defaults to current git SHA'
+ echo '--runtine a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)'
exit 0
;;
- --no-web-build)
+ --no-build)
build=false
shift
;;
@@ -21,6 +23,11 @@ while test $# -gt 0; do
runtime=$1
shift
;;
+ --version-suffix)
+ shift
+ version_suffix=$1
+ shift
+ ;;
*)
break
;;
@@ -33,8 +40,8 @@ if [ -z "$runtime" ]; then
fi
if [ "$build" == true ]; then
- echo $'\n> bin/build --web-only --skip-tests\n'
- bin/build --web-only --skip-tests
+ echo $'\n> bin/build\n'
+ bin/build
else
echo $'\nbuild skipped\n'
fi
@@ -43,7 +50,7 @@ cd src/slskd
echo $'\n> pwd\n'
pwd
-echo $'\n> dotnet publish ... --runtime '$runtime$'\n'
+echo $'\n> dotnet publish ... --runtime '$runtime$' --version-suffix '$version_suffix$'\n'
rm -rf dist/$runtime/*
dotnet publish \
--configuration Release \
@@ -53,6 +60,7 @@ dotnet publish \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:CopyOutputSymbolsToPublishDirectory=false \
--self-contained \
+ --version-suffix $version_suffix \
--runtime $runtime \
--output ../../dist/$runtime
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index 7163629d..14c2ad94 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -7,7 +7,7 @@
<PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
- <Version>0.0.1</Version>
+ <VersionPrefix>0.0.1</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">