69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
name: Publish release zip
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'OFDLV*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET 8.x
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: 8.x
|
|
|
|
- name: Show .NET version
|
|
run: dotnet --version
|
|
|
|
- name: Extract version
|
|
id: version
|
|
run: |
|
|
VERSION="${GITEA_REF_NAME#OFDLV}"
|
|
echo "Version: $VERSION"
|
|
echo "version=$VERSION" >> "$GITEA_OUTPUT"
|
|
|
|
- name: Build for Windows and Linux
|
|
run: |
|
|
dotnet publish -p:Version=${{ steps.version.outputs.version }} -p:WarningLevel=0 -c Release -r win-x86 --self-contained true -p:PublishSingleFile=true -o outwin
|
|
dotnet publish -p:Version=${{ steps.version.outputs.version }} -p:WarningLevel=0 -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o outlin
|
|
|
|
- name: Copy and patch extra files
|
|
run: |
|
|
cp ./OF\ DL/rules.json outwin/
|
|
chmod +x ./outlin/OF\ DL
|
|
cd outwin
|
|
../outlin/OF\ DL --non-interactive || true
|
|
mkdir -p cdm/devices/chrome_1610
|
|
wget https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
|
|
unzip ffmpeg-release-essentials.zip ffmpeg\*/bin/ffmpeg.exe ffmpeg\*/LICENSE
|
|
mv ffmpeg*/bin/ffmpeg.exe .
|
|
mv ffmpeg*/LICENSE LICENSE.ffmpeg
|
|
zip ../OFDLV${{ steps.version.outputs.version }}.zip OF\ DL.exe e_sqlite3.dll rules.json config.conf cdm ffmpeg.exe LICENSE.ffmpeg
|
|
cd ..
|
|
|
|
- name: Create Gitea release
|
|
uses: https://gitea.com/actions/create-release@v1
|
|
with:
|
|
tag_name: ${{ gitea.ref }}
|
|
release_name: ${{ steps.version.outputs.version }}
|
|
draft: true
|
|
prerelease: false
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Upload release asset
|
|
uses: https://gitea.com/actions/upload-release-asset@v1
|
|
with:
|
|
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
|
asset_path: ./OFDLV${{ steps.version.outputs.version }}.zip
|
|
asset_name: OFDLV${{ steps.version.outputs.version }}.zip
|
|
asset_content_type: application/zip
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|