mirror of https://github.com/ErsatzTV/ErsatzTV.git
1 changed files with 59 additions and 0 deletions
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
name: Publish |
||||
on: |
||||
release: |
||||
types: [ published ] |
||||
jobs: |
||||
release: |
||||
name: Release |
||||
strategy: |
||||
matrix: |
||||
kind: [ 'linux', 'windows', 'macOS' ] |
||||
include: |
||||
- kind: linux |
||||
os: ubuntu-latest |
||||
target: linux-x64 |
||||
- kind: windows |
||||
os: windows-latest |
||||
target: win-x64 |
||||
- kind: maxOS |
||||
os: macos-latest |
||||
target: osx-x64 |
||||
runs-on: ${{ matrix.os }} |
||||
steps: |
||||
- name: Get the sources |
||||
uses: actions/checkout@v2 |
||||
|
||||
- name: Setup .NET Core |
||||
uses: actions/setup-dotnet@v1 |
||||
with: |
||||
dotnet-version: 5.0.x |
||||
|
||||
- name: Install dependencies |
||||
run: dotnet restore |
||||
|
||||
- name: Build |
||||
shell: bash |
||||
run: | |
||||
# Define some variables for things we need |
||||
tag=$(git describe --tags --abbrev=0) |
||||
release_name="ErsatzTV-$tag-${{ matrix.target }}" |
||||
|
||||
# Build everything |
||||
dotnet publish src/ErsatzTV/ErsatzTV.csproj --framework net50 --runtime "${{ matrix.target }}" -c Release -o "$release_name" |
||||
|
||||
# Pack files |
||||
if [ "${{ matrix.target }}" == "win-x64" ]; then |
||||
7z a -tzip "${release_name}.zip" "./${release_name}/*" |
||||
else |
||||
tar czvf "${release_name}.tar.gz" "$release_name" |
||||
fi |
||||
|
||||
# Delete output directory |
||||
rm -r "$release_name" |
||||
|
||||
- name: Publish |
||||
uses: softprops/action-gh-release@v1 |
||||
with: |
||||
files: "ErsatzTV*" |
||||
env: |
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
||||
Loading…
Reference in new issue